W
Wasp-lang•6mo 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)•6mo 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)•6mo ago
It’s easily defined in the configuration file
martinsos
martinsos•6mo 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?