[SOLVED] Help with auth vs unauth routing...
Hi! 👋 Anyone have techniques or ideas on setting up routing within the
main.wasp
to handle unauth routes vs auth routes if I want all auth to be prefixed with /app
and redirect there if logged in? I know there is a rootComponent
config but that applies to all. My idea was to have all the logged in app under /app
and the landing pages to be /
.3 Replies
Hi @Dayne check this out https://wasp-lang.dev/docs/auth/overview#protecting-a-page-with-authrequired
Using Auth | Wasp
Auth is an essential piece of any serious application. Coincidentally, Wasp provides authentication and authorization support out of the box.
It’s easily defined in the configuration file
@Dayne was this the answer you were looking for? I believe you probably ended up still putting
authRequired
on every page
declaration, but instead you likely wanted to define it just one for app/
and then have it be valid for any pages under that router, right?