From f3ff3f62c7eedc51c252cf96e872d108463cc175 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 9 Dec 2015 21:39:07 -0800 Subject: [PATCH] GUAC-1430: Wrap error to ensure that required fields are always present. --- .../src/main/webapp/app/auth/service/authenticationService.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/guacamole/src/main/webapp/app/auth/service/authenticationService.js b/guacamole/src/main/webapp/app/auth/service/authenticationService.js index 5dd549a34..51042a1e5 100644 --- a/guacamole/src/main/webapp/app/auth/service/authenticationService.js +++ b/guacamole/src/main/webapp/app/auth/service/authenticationService.js @@ -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);