Uh oh!
There was an error while loading. Please reload this page.
fix: Redirect user to login if session is terminated - #49208
Conversation
susnux
commented
Nov 11, 2024
/backport to stable30 |
susnux
commented
Nov 11, 2024
/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?
susnux
commented
Nov 13, 2024
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. |
Uh oh!
There was an error while loading. Please reload this page.
1d1cb05 to
8f5c8e1Comparesusnux
commented
Nov 17, 2024
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
1df2314Compareskjnldsv
commented
Dec 19, 2024
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
inet-cologne
commented
Feb 15, 2025
@susnux , @skjnldsv , @artonge , @Pytal Thanks for checking that!! |
inet-cologne
commented
Feb 26, 2025
jolly-jump
commented
Apr 29, 2025
@susnux , @skjnldsv , @artonge , @Pytal can you please check, if you are experiencing the login problems as well? Thanks! |
jolly-jump
commented
May 3, 2025
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