Log out and go to the login page when the session expires
Maintainers usually reply within 1 day
@ayushnandi718-dev is already working on this.
Since Oct 21, 2026.
Assessment
This issue has not been assessed yet.
Description
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.
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 2
- Avg merge
- 6h 50m
- Merged PRs (30d)
- 37
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the 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 KEX-03/taskflow
-
Due dates (3/3): highlight overdue tasksPossibly taken @maansi1004 claimed this 1 day ago. Opendifficulty: medium enhancement frontend hacktoberfest help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
KEX-03/taskflow#70 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Keep keyboard focus inside open dialogsPossibly taken @100rabheimer claimed this 4 days ago. Opendifficulty: easy enhancement frontend good first issue hacktoberfest
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
KEX-03/taskflow#62 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Announce the character counters to screen readersPossibly taken @Anushka157-cha claimed this 1 day ago. Opendifficulty: easy enhancement frontend good first issue hacktoberfest
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
KEX-03/taskflow#61 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Show a "Page not found" page for unknown URLsPossibly taken @Salypse claimed this 4 days ago. Opendifficulty: easy enhancement frontend good first issue hacktoberfest
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
KEX-03/taskflow#59 · 8 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Limit task title and description length in the task formPossibly taken @anthony95macias claimed this 5 days ago. Opendifficulty: easy enhancement frontend good first issue hacktoberfest
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
KEX-03/taskflow#41 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
flarum/framework#5301 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
AOSSIE-Org/BabyNest#284 ·
Maintainers usually reply within 1 day
-
status:untriaged
Difficulty 1/5 Under an hour Newbie friendliness 86/100
midnightntwrk/servicedesk#275 ·
Maintainers usually reply within 1 day