GUAC-1430: Wrap error to ensure that required fields are always present.

This commit is contained in:
James Muehlner
2015-12-09 21:39:07 -08:00
parent 1b4181a200
commit f3ff3f62c7

View File

@@ -155,6 +155,10 @@ angular.module('auth').factory('authenticationService', ['$injector',
// If authentication fails, propogate failure to returned promise
.error(function authenticationFailed(error) {
// Ensure error object exists, even if the error response is not
// coming from the authentication REST endpoint
error = new Error(error);
// Request credentials if provided credentials were invalid
if (error.type === Error.Type.INVALID_CREDENTIALS)
$rootScope.$broadcast('guacInvalidCredentials', parameters, error);