leerob / daydrink

Find the best drink deals and happy hours in your area.

Home Page:https://daydrink.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do you implement protected routes ?

udithv opened this issue · comments

Is there a way you can implement redirect on protected routes using useAuth.

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.