summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-12-07 17:24:11 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-12-08 11:48:35 +0000
commitc003a56816eebac100720d6523ddb6836ef99e4e (patch)
tree9ebd2d0ba16e772d167d758d5f3fb472352ae7dc /apps/files
parent5a4738430056627a5a851fbeb599810637329c6e (diff)
downloadnextcloud-server-c003a56816eebac100720d6523ddb6836ef99e4e.tar.gz
nextcloud-server-c003a56816eebac100720d6523ddb6836ef99e4e.zip
Stop reloading file list when getting 401 error on root dir
When reaching the root dir, instead of reloading the file list we reload the page completely. This trigger a redirection to the login page automatically with the correct ?redirect_url= in thr url. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/filelist.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 11d0bc4511d..f2457e63c3e 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -2087,6 +2087,10 @@
this.hideMask();
if (status === 401) {
+ if (this.getCurrentDirectory() === '/') {
+ // Give up, if we are not authorized to access user root folder, we are logged out
+ location.reload(); // this will redirect the user to the login page while saving the current url
+ }
return false;
}