-
Notifications
You must be signed in to change notification settings - Fork 81
Description
Expected Behavior
When a user is already logged in, they should not be able to access the login page. Instead, they should be automatically redirected to the dashboard or home page.
Current Behavior
After logging in, if the user manually navigates to the login page URL (e.g., /login), the login page still loads instead of redirecting.
Possible Solution
Implement an authentication guard on the login route that checks if the user is authenticated. If yes, redirect them to the dashboard or another appropriate page.
Steps to Reproduce
- Open the app and log in with valid credentials.
- After successful login, open a new tab or browser window.
- Navigate to the login page URL (e.g., example.com/login).
- Notice that the login page is displayed instead of a redirect.
Context (Environment)
This affects user experience by allowing logged-in users to see pages that are irrelevant to them, possibly causing confusion. It’s important to keep navigation flow logical and secure.
OS: macOS (can be any)
Browser: Chrome (or others)
Detailed Description
Users should have a smooth experience where once authenticated, pages like login or signup become inaccessible to them unless they log out. Currently, this navigation control is missing, allowing access to login page post-authentication.
Possible Implementation
Add route protection or conditional redirects in the routing logic, such as:
React: Use a PrivateRoute / PublicRoute pattern with redirects.