Is there a way to put integrate blog and docs with the login authentication?
I was working on a closed source platform for which the documentation is supposed to be private.
The astro based documentation and blog are effect but how can I integrate them directly in app so that one can access them only after logging in.
9 Replies
Hi @ComputO. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources provided, there isn't specific information about integrating a blog and documentation system directly with Wasp's authentication. However, I can provide some general guidance on how you might approach this using Wasp's authentication features:
1. Page Protection: Wasp allows you to protect pages by setting the
authRequired
property to true
. As mentioned in the Auth Overview documentation, you can use this to ensure only authenticated users can access certain pages:
2. Redirect Unauthenticated Users: When you set up authentication in your Wasp app, you can specify where unauthenticated users should be redirected using the onAuthFailedRedirectTo
field, as mentioned in the Auth API Reference.
3. Server-side Protection: For any API routes or operations that serve your documentation or blog content, you can use the context.user
object to check if a user is authenticated and deny access if they're not. The Auth Overview documentation provides an example of how to do this:
To fully integrate your Astro-based documentation and blog with Wasp, you might need to:
1. Port your Astro content to React components that can be used within Wasp.
2. Set up the appropriate pages and routes in your Wasp app.
3. Implement the necessary queries or actions to fetch and display your content.
4. Ensure all these are protected using the authentication methods described above.
However, it's important to note that the provided knowledge sources don't contain specific information about integrating external documentation systems or blogs with Wasp. You might need to consult additional resources or the Wasp community for more detailed guidance on this specific use case.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @ComputO, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Hey @ComputO.
Still need help with this?
Yes ... I was able to deploy the blog and docs but could not integrate it with login
Wohooo @ComputO, you just became a Waspeteer level 1!
In that case, I think I'll leave this to @Vinny (@Wasp), the creator of Open saas.\
This won't be possible unless you build a blog within the Wasp app itself, or you'd have to integrate a separate auth system for the blog only.
For implementing a blog within the Wasp app, the answer Kapa gave above is a good start. I know that @NEROX also has implemented his own blog within his Wasp/Open SaaS app. Maybe he has some extra tips 🙂
Building components again in wasp app seems a bit of a stretch.. if you know anyone who has directly integrated astro in wasp app that would help a lot.. or else currently we were thinking of adding auth to astro with same users & auth tables that we have through wasp
Maybe you can check: https://github.com/NeroxTGC/WaspTemplate
GitHub
GitHub - NeroxTGC/WaspTemplate: Simple Blog made with Wasp
Simple Blog made with Wasp. Contribute to NeroxTGC/WaspTemplate development by creating an account on GitHub.
first of all cool repo .. and cool demos .. but all my docs are already in Md .. so was searching for a direct lift and shift