parent
343d293001
commit
76ec022dc3
1 changed files with 10 additions and 7 deletions
|
@ -253,13 +253,6 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', 'PlanServi
|
||||||
|
|
||||||
// Handle session expiration.
|
// Handle session expiration.
|
||||||
Restangular.setErrorInterceptor(function(response) {
|
Restangular.setErrorInterceptor(function(response) {
|
||||||
//TODO: remove check for error_type (old style errors)
|
|
||||||
var invalid_token = response.data['title'] == 'invalid_token' || response.data['error_type'] == 'invalid_token';
|
|
||||||
if (response.status == 401 && invalid_token && response.data['session_required'] !== false) {
|
|
||||||
$('#sessionexpiredModal').modal({});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response.status == 503) {
|
if (response.status == 503) {
|
||||||
$('#cannotContactService').modal({});
|
$('#cannotContactService').modal({});
|
||||||
return false;
|
return false;
|
||||||
|
@ -270,6 +263,16 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', 'PlanServi
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!response.data) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var invalid_token = response.data['title'] == 'invalid_token' || response.data['error_type'] == 'invalid_token';
|
||||||
|
if (response.status == 401 && invalid_token && response.data['session_required'] !== false) {
|
||||||
|
$('#sessionexpiredModal').modal({});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Reference in a new issue