From dc88c27149ba554b7801ff45fcabd88a70d72310 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 21 Apr 2015 22:03:45 -0700 Subject: [PATCH] GUAC-1161: Do not continue routing if authentication fails. --- .../webapp/app/index/config/indexRouteConfig.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/guacamole/src/main/webapp/app/index/config/indexRouteConfig.js b/guacamole/src/main/webapp/app/index/config/indexRouteConfig.js index 6942537ba..e8efc5676 100644 --- a/guacamole/src/main/webapp/app/index/config/indexRouteConfig.js +++ b/guacamole/src/main/webapp/app/index/config/indexRouteConfig.js @@ -39,26 +39,17 @@ angular.module('index').config(['$routeProvider', '$locationProvider', * * @returns {Promise} * A promise which resolves successfully only after an attempt to - * re-authenticate has been made. + * re-authenticate has been made. If the authentication attempt fails, + * the promise will be rejected. */ var updateCurrentToken = ['$injector', function updateCurrentToken($injector) { // Required services var $location = $injector.get('$location'); - var $q = $injector.get('$q'); var authenticationService = $injector.get('authenticationService'); - // Promise for authentication attempt - var authAttempt = $q.defer(); - // Re-authenticate including any parameters in URL - authenticationService.updateCurrentToken($location.search()) - ['finally'](function authenticationAttemptComplete() { - authAttempt.resolve(); - }); - - // Return promise that will resolve regardless of success/failure - return authAttempt.promise; + return authenticationService.updateCurrentToken($location.search()); }];