]> source.dussan.org Git - nextcloud-server.git/commitdiff
Stop reloading file list when getting 401 error on root dir
authorCarl Schwan <carl@carlschwan.eu>
Tue, 7 Dec 2021 16:24:11 +0000 (17:24 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Wed, 8 Dec 2021 11:39:57 +0000 (11:39 +0000)
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>
apps/files/js/filelist.js

index b3d88085b7cc3af9e619818167018e2e834252d2..fbd07729c74e747e9faf7350131f2540d5822daf 100644 (file)
                        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;
                        }