From c003a56816eebac100720d6523ddb6836ef99e4e Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 7 Dec 2021 17:24:11 +0100 Subject: [PATCH 1/2] 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(+) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 11d0bc4511dac..f2457e63c3e79 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; } From 5aef34de491001b74e6dc34aab894d314e6bf3bb Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 7 Dec 2021 17:48:28 +0100 Subject: [PATCH 2/2] 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(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index f2457e63c3e79..c14526fe6866d 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2087,11 +2087,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?