fix: Redirect user to login if session is terminated#49208
Conversation
|
/backport to stable30 |
|
/backport to stable29 |
artonge
left a comment
There was a problem hiding this comment.
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 <opensource@fthiessen.de>
8f5c8e1 to
1df2314
Compare
|
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
@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