How do you implement protected routes ?
udithv opened this issue · comments
Udith Victor commented
Is there a way you can implement redirect on protected routes using useAuth.
Lee Robinson commented
Sure, anything is possible. The way this repository is set up, it's doing useAuth
on the client side. You could add a check inside that hook that if the user doesn't exist in state, use router.push
to go to a different route.