summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authoricewind1991 <robin@icewind.nl>2014-07-04 16:39:00 +0200
committericewind1991 <robin@icewind.nl>2014-07-04 16:39:00 +0200
commitd3fab824f7052a8df400890833a0f6743769422c (patch)
treeeb04908d6deb044ab6fd2f73030efce561efeaf2 /apps/files/js
parent5e89b53e78240cf3eee02db02ae5c409dc1bcc1f (diff)
parent4fe1cdd2a7a1930d8ca0cb5bc23e5bfa22be6e55 (diff)
downloadnextcloud-server-d3fab824f7052a8df400890833a0f6743769422c.tar.gz
nextcloud-server-d3fab824f7052a8df400890833a0f6743769422c.zip
Merge pull request #9445 from owncloud/filelist-auth-error
Reload the page when the files app encounters an authentication error
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/filelist.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 9c6d31ee017..3e311655c91 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -947,6 +947,13 @@
this.hideMask();
if (!result || result.status === 'error') {
+ // if the error is not related to folder we're trying to load, reload the page to handle logout etc
+ if (result.data.error === 'authentication_error' ||
+ result.data.error === 'token_expired' ||
+ result.data.error === 'application_not_enabled'
+ ) {
+ OC.redirect(OC.generateUrl('apps/files'));
+ }
OC.Notification.show(result.data.message);
return false;
}
@@ -970,7 +977,7 @@
}
this.setFiles(result.data.files);
- return true
+ return true;
},
updateStorageStatistics: function(force) {
@@ -1568,7 +1575,7 @@
numMatch=base.match(/\((\d+)\)/);
var num=2;
if (numMatch && numMatch.length>0) {
- num=parseInt(numMatch[numMatch.length-1])+1;
+ num=parseInt(numMatch[numMatch.length-1], 10)+1;
base=base.split('(');
base.pop();
base=$.trim(base.join('('));