Adding global error handler for ajax calls which run into redirections or unauthorized responses
This commit is contained in:
parent
46b39c3465
commit
294dcb4eff
|
@ -1311,6 +1311,13 @@ function initCore() {
|
|||
$('html').addClass('edge');
|
||||
}
|
||||
|
||||
$( document ).ajaxError(function( event, request, settings ) {
|
||||
if (_.contains([302, 307, 401], request.status)) {
|
||||
var app = $('#content').attr('class').substring(4);
|
||||
OC.redirect(OC.generateUrl('apps/' + app));
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Calls the server periodically to ensure that session doesn't
|
||||
* time out
|
||||
|
|
Loading…
Reference in New Issue