W
Wasp-lang•12mo ago
Dayne

[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
Vinny (@Wasp)
Vinny (@Wasp)•12mo ago
Using Auth | Wasp
Auth is an essential piece of any serious application. Coincidentally, Wasp provides authentication and authorization support out of the box.
Vinny (@Wasp)
Vinny (@Wasp)•12mo ago
It’s easily defined in the configuration file
martinsos
martinsos•12mo ago
@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?
Want results from more Discord servers?
Add your server