Return application/problem+json format errors and provide error endpoint

to dereference error codes.
This commit is contained in:
Evan Cordell 2016-04-11 14:51:58 -04:00
parent 8c81915f38
commit 9c08717173
7 changed files with 156 additions and 39 deletions

View file

@ -211,8 +211,8 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', 'PlanServi
// Handle session expiration.
Restangular.setErrorInterceptor(function(response) {
if (response.status == 401 && response.data['error_type'] == 'invalid_token' &&
response.data['session_required'] !== false) {
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;
}