-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Redirect user to login if session is terminated #49208
base: master
Are you sure you want to change the base?
Conversation
/backport to stable30 |
/backport to stable29 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be added to the @nextcloud/axios
lib?
But is the webdav lib using @nc/axios
?
No, similar as the other interceptors, this is not a feature developers can opt-in with using nc-axios, but it is a core feature. |
If a session timed out or was closed in another tab, then currently the user gets random error messages. This intercepts 401 responses (should only happen if logged out, or the users does something wrong). If we get a 401, we make sure its because of the session, by checking if the user can access the files app. If that is also the case we forward the user to the login page and set the redirect URL to the last used URL. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1d1cb05
to
8f5c8e1
Compare
Tests added. |
Summary
If a session timed out or was closed in another tab, then currently the user gets random error messages. This intercepts 401 responses (should only happen if logged out, or the users does something wrong).
If we get a 401, we make sure its because of the session, by checking if the user can access the files app.
If that is also the case we forward the user to the login page and set the redirect URL to the last used URL.
Screen recording
Bildschirmaufnahme_20241111_174951.webm
Checklist