Custom Auth: Redirect user not logged in as normal user.

Hi Everyone…

I just have a simple question…

I am using custom auth… & All my pages have minimum role as Normal User…

So how do i redirect a person… who isn’t logged in as a normal user or above… To the sign up pages…

Also I have used conditional Guard to do this… But its not redirecting…

@fmota could you help?

Hi @illuminating_egret this is currently possible by setting a default component category, by going in the components tab you can individually set this value, you can then choose Unauthorized, which is then going to be the component rendered instead of the unauthorized page, which you can use to redirect your users to your sign up page, this is currently undocumented but we are looking into improving our docs and examples around this scenarios

Hey I did convert the catogory of the main pagelayout component as unauthorized… Now… Its only rendering that component… Now how do i use it to redirect users to signin / signup page…
also as it has the pagelayout… what if someone stops redirecting in their browser , my component would be vulnerable in terms of security …

You can in that component add a condition guard or a side effect that directs to your sign in / sign up page, I didn’t get how someone stopping the redirect would create a vulnerability, as you aren’t supposed to expose any secrets or sensible information in this page, if someone would to stop the redirect they would only end up in a broken app state