issues
search
chingu-voyages
/
v51-tier3-team-31
Add-project-description-here | Voyage-51 | https://chingu.io/ | Twitter: https://twitter.com/ChinguCollabs
0
stars
0
forks
source link
feature: navigete user to login if not logged in
#123
Closed
Homvi
closed
1 month ago
Homvi
commented
1 month ago
PR Title: Implement Protected Route Redirection
Description
Added logic in
ProtectedLayout
to redirect users to the login page if they are not authenticated.
Utilized
useEffect
to monitor the
isLoggedIn
state from the
useAuth
hook.
Prevented the rendering of protected components when the user is not logged in, enhancing security and user experience.
Changes Made
Updated
ProtectedLayout
to include authentication check and redirection.
Ensured that protected routes are only accessible to logged-in users.
PR Title: Implement Protected Route Redirection
Description
ProtectedLayout
to redirect users to the login page if they are not authenticated.useEffect
to monitor theisLoggedIn
state from theuseAuth
hook.Changes Made
ProtectedLayout
to include authentication check and redirection.