Log out and go to the login page when the session expires
I maintainer di solito rispondono entro 1 giorno
@ayushnandi718-dev ci sta già lavorando.
Dal 21/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Context
Login tokens expire after a while. When that happens, the API answers with 401, and client/src/utils/api.js removes the token from localStorage, but that's all. The app still thinks the user is logged in. They stay on the page, every action silently fails, and they only end up on the login page after reloading.
Files likely involved
client/src/utils/api.js(the response interceptor)client/src/context/AuthContext.jsx(logout)
Acceptance criteria
- When any request returns 401 while the user is logged in, the app logs them out (the same as clicking Logout), goes to
/login, and shows the toast "Your session has expired. Please log in again." - A wrong password on the login page must not trigger this.
POST /auth/loginalso returns 401 for wrong credentials, so that case keeps showing "Invalid email or password." as today. - Several requests failing at the same moment cause one logout and one toast, not several.
- Avoid importing React code into
api.js. One clean way is forapi.jsto accept a callback (for examplesetUnauthorizedHandler(fn)) thatAuthContextregisters.
How to test
- Log in, then in DevTools → Application → Local Storage, change the
tokenvalue to something invalid. - Click around (open Tasks, create a task): you're sent to the login page once, with the "session expired" toast.
- On the login page, enter a wrong password: the normal error shows, with no redirect and no "session expired" toast.
New here? 👋 Comment below to ask to work on this issue, and wait to be assigned. Then follow CONTRIBUTING.md for setup and how to open a pull request. Questions are welcome in the comments or in Discussions.
- Lingua principale
- JavaScript
- Stelle
- 3
- Fork
- 2
- Merge medio
- 6h 50m
- PR unite (30g)
- 37
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di KEX-03/taskflow
-
Due dates (3/3): highlight overdue tasksForse già presa @maansi1004 l’ha presa 1 giorno fa. Apertadifficulty: medium enhancement frontend hacktoberfest help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
KEX-03/taskflow#70 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Keep keyboard focus inside open dialogsForse già presa @100rabheimer l’ha presa 4 giorni fa. Apertadifficulty: easy enhancement frontend good first issue hacktoberfest
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
KEX-03/taskflow#62 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Announce the character counters to screen readersForse già presa @Anushka157-cha l’ha presa 2 giorni fa. Apertadifficulty: easy enhancement frontend good first issue hacktoberfest
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
KEX-03/taskflow#61 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Show a "Page not found" page for unknown URLsForse già presa @Salypse l’ha presa 4 giorni fa. Apertadifficulty: easy enhancement frontend good first issue hacktoberfest
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
KEX-03/taskflow#59 · 8 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Limit task title and description length in the task formForse già presa @anthony95macias l’ha presa 5 giorni fa. Apertadifficulty: easy enhancement frontend good first issue hacktoberfest
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
KEX-03/taskflow#41 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di KEX-03/taskflow
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
fossasia/scrum_helper#949 ·
I maintainer di solito rispondono entro 2 giorni
-
Learn Faust tutorial: Blocks step says Faust loads block CSS, but no WordPress styles are appliedAperta[Type] Bug Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
TheOdinProject/curriculum#31493 ·
I maintainer di solito rispondono entro 1 giorno
-
[Report] Some official plugins are marked as Stable, but their Readme says they are experimentalAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
TiddlyWiki/TiddlyWiki5#10061 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation ready
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno