[BUG]: Incorrect redirect route after token expiry causes silent auth failure
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
- Domain
- authentication, frontend
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 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
- Log in to the application.
- Open browser DevTools.
- Go to Application → Local Storage.
- Delete the stored
tokenvalue or manually expire the JWT token. - Refresh the page.
- 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
- I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- I have searched existing issues to avoid duplicates
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/DebateAI
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
AOSSIE-Org/DebateAI#582 · 2 comments ·
Maintainers usually reply within 5 days
-
[BUG]: Silent error swallow when back-filling default rating in GetProfile (profile_controller.go)Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
AOSSIE-Org/DebateAI#578 · 2 comments ·
Maintainers usually reply within 5 days
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AOSSIE-Org/DebateAI#573 · 4 comments ·
Maintainers usually reply within 5 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
AOSSIE-Org/DebateAI#568 · 2 comments ·
Maintainers usually reply within 5 days
-
[BUG]: Direct state mutation in useMemo for sorting debaters causes stale UI and live update issuesOpenbug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
AOSSIE-Org/DebateAI#553 · 2 comments ·
Maintainers usually reply within 5 days
All issues in AOSSIE-Org/DebateAI
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
betagouv/mon-entreprise#4699 ·
Maintainers usually reply within 3 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jaegertracing/jaeger-ui#4547 · 3 comments ·
Maintainers usually reply within 1 day
-
ai-driven-qa
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
linagora/twake-calendar-frontend#1467 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
need4deed-org/sdk#267 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
auth0/universal-login#414 ·
Maintainers usually reply within 1 day