Redirect to login form on failed XSRF token
Author: Jari27Created Dec 9, 2025Updated Feb 10, 2026
Labelsenhancement
Proposed change
Right now, if there's a mismatch with the XSRF token, the user sees an error message. The user then manually has to navigate back to the login page to get a new token assigned. This is annoying for users.
The proposed change is to automatically navigate the user back to the login page, where they will get a new token assigned.
Alternative options
- Do nothing: worse user experience
- Automatic token refresh: too much effort
Who would use this feature?
Anybody who users JupyterHub and gets logged after a session expires and only logs in a few hours later.
(Optional): Suggest a solution
See above
Source: jupyterhub/jupyterhub