summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-12-07 17:24:11 +0100
committerCarl Schwan <carl@carlschwan.eu>2021-12-07 17:24:11 +0100
commit50d256f9597d9e9126344a5428dc23f3e82559a6 (patch)
tree1e06702b0e7698f5026ae1cb3cc276eb3cc02055 /apps
parent4ed014ca86892498c585cf28603c768db86b7e71 (diff)
downloadnextcloud-server-50d256f9597d9e9126344a5428dc23f3e82559a6.tar.gz
nextcloud-server-50d256f9597d9e9126344a5428dc23f3e82559a6.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')
-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 b3d88085b7c..fbd07729c74 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -2232,6 +2232,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;
}