-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix: Redirect user to login if session is terminated #49208
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
Conversation
|
/backport to stable30 |
|
/backport to stable29 |
artonge
left a comment
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. |
1d1cb05 to
8f5c8e1
Compare
|
Tests added. |
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 <[email protected]>
8f5c8e1 to
1df2314
Compare
|
/compile |
Signed-off-by: nextcloud-command <[email protected]>
|
@susnux , @skjnldsv , @artonge , @Pytal Thanks for checking that!! |
|
@susnux , @skjnldsv , @artonge , @Pytal can you please check, if you are experiencing the login problems as well? Thanks! |
Hi again, Can you rule out that your code changes here could lead to login-problem in combination with LDAP/AD? Did you test your changes with such a setting? Thanks! |
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