From f9d8abcfdeb50c8e8630aafb3fc19ff95be42670 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 22 Aug 2022 09:17:29 -0700 Subject: [PATCH] GUACAMOLE-990: Clear out any previous authentication token that is known to be invalid. --- .../src/app/auth/service/authenticationService.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/guacamole/src/main/frontend/src/app/auth/service/authenticationService.js b/guacamole/src/main/frontend/src/app/auth/service/authenticationService.js index 944fd4a9a..199d6cb2e 100644 --- a/guacamole/src/main/frontend/src/app/auth/service/authenticationService.js +++ b/guacamole/src/main/frontend/src/app/auth/service/authenticationService.js @@ -198,12 +198,16 @@ angular.module('auth').factory('authenticationService', ['$injector', ['catch'](requestService.createErrorCallback(function authenticationFailed(error) { // Request credentials if provided credentials were invalid - if (error.type === Error.Type.INVALID_CREDENTIALS) + if (error.type === Error.Type.INVALID_CREDENTIALS) { $rootScope.$broadcast('guacInvalidCredentials', parameters, error); + clearAuthenticationResult(); + } // Request more credentials if provided credentials were not enough - else if (error.type === Error.Type.INSUFFICIENT_CREDENTIALS) + else if (error.type === Error.Type.INSUFFICIENT_CREDENTIALS) { $rootScope.$broadcast('guacInsufficientCredentials', parameters, error); + clearAuthenticationResult(); + } // Abort rendering of page if an internal error occurs else if (error.type === Error.Type.INTERNAL_ERROR)