From 50d256f9597d9e9126344a5428dc23f3e82559a6 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 7 Dec 2021 17:24:11 +0100 Subject: 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 --- apps/files/js/filelist.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps/files/js') 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; } -- cgit v1.2.3 From 170ca81760007a31bd7bb65a5a0b17a67aab84e6 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 7 Dec 2021 17:48:28 +0100 Subject: Reload page on 401 since there is an authentification problem Signed-off-by: Carl Schwan --- apps/files/js/filelist.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'apps/files/js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index fbd07729c74..6fe9895c60e 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2232,11 +2232,9 @@ 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; + // We are not authentificated, so reload the page so that we get + // redirected to the login page while saving the current url. + location.reload(); } // Firewall Blocked request? -- cgit v1.2.3