Use ApiService to get error message

This commit is contained in:
Evan Cordell 2016-04-11 17:28:49 -04:00
parent b5db41920f
commit 7c361c07f9
5 changed files with 8 additions and 4 deletions

View file

@ -211,6 +211,7 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', 'PlanServi
// Handle session expiration.
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({});