Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG]: Incorrect redirect route after token expiry causes silent auth failure

Open Beginner friendly
#581 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript

Research direction

The bug is in frontend/src/context/authContext.tsx, in the verifyToken function where navigate('/login') is called. The correct route is /auth. Check the route definitions in the router configuration to confirm /auth is the authentication page. After changing the route, test by expiring the token as described and verifying the redirect goes to /auth.

Written by the indexing model from the issue text.

Description

bug
Bug Description

When a user's authentication token is expired or invalid, the app attempts to redirect to /login, which is not a registered route in the application.

The wildcard route (path='*') catches /login and redirects the user to / (homepage) instead of the authentication page. As a result, users are silently dropped on the homepage without any error message or prompt to log in again.

The authentication page is registered at /auth.

Steps to Reproduce
  1. Log in to the application.
  2. Open browser DevTools.
  3. Go to Application → Local Storage.
  4. Delete the stored token value or manually expire the JWT token.
  5. Refresh the page.
  6. Observe the redirect behavior.

Expected: User is redirected to /auth (login/signup page).

Actual: User is redirected to / (homepage) without any authentication prompt.

Logs and Screenshots

No console errors are required to reproduce this issue.

The issue can be traced to the redirect inside verifyToken in:

frontend/src/context/authContext.tsx

Current code:

navigate('/login');
Environment Details

React + Vite + TypeScript, using react-router-dom.
File: frontend/src/context/authContext.tsx
Authentication route: /auth

Impact

Medium - Feature works but has issues

Code of Conduct
Dominant language
TypeScript
Stars
88
Forks
211
Avg merge
9d 18h
Merged PRs (30d)
52

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AOSSIE-Org/DebateAI

All issues in AOSSIE-Org/DebateAI

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.