-
-
Notifications
You must be signed in to change notification settings - Fork 123
feat: prevent authenticated users from accessing auth routes #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add middleware logic to redirect authenticated users from /auth/signin and /auth/register - Implement client-side auth route protection hook - Add proper skeleton loading states for auth pages - Include safe redirect handling with redirectTo parameter - Add user-friendly toast messages for better UX Fixes Muneerali199#292
|
@techcroft1 is attempting to deploy a commit to the muneerali199's projects Team on Vercel. A member of the Team first needs to authorize it. |
👷 Deploy request for docmagic-muneer pending review.Visit the deploys page to approve it
|
👷 Deploy request for docmagic1 pending review.Visit the deploys page to approve it
|
|
@sandeshkhairnar Please resolve conflicts first |
|
@yashksaini-coder could you please check if I have resolved the conflict |
lib/auth-utils.ts
Outdated
| '/payment-demo', | ||
| ]; | ||
|
|
||
| export const AUTH_ROUTES = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have the types created in /utils and then import here to use. Define them in one place together @sandeshkhairnar
|
@yashksaini-coder please review the changes and let me know if anything needs to be updated.
|
yashksaini-coder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼 Now its proper, @Muneerali199 please check the vercel deployment

📋 Description
Prevents authenticated users from accessing
/auth/signinand/auth/registerroutes by automatically redirecting them to their intended destination or home page.🔗 Linked Issue
Closes #292
✨ Changes Made
useAuthRouteProtectionhook as backup with user-friendly feedbackredirectToquery parameter for seamless user experience🧪 Testing
/auth/signin/auth/registerredirectToparameter '/ ' works correctly🎯 Benefits
📱 Screenshots