Skip to content

bug: Logged-in users can still access login page #106

@vishnukothakapu

Description

@vishnukothakapu

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

  1. Open the app and log in with valid credentials.
  2. After successful login, open a new tab or browser window.
  3. Navigate to the login page URL (e.g., example.com/login).
  4. 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.

Metadata

Metadata

Labels

bugSomething isn't workinghacktoberfestIssues marked with this label are part of Hacktoberfest and open for contributions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions