mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUACAMOLE-526: Invoke logout() for the cached token BEFORE storing the new token. The logout() call erroneously invalidates the new token otherwise.
This commit is contained in:
		| @@ -168,7 +168,6 @@ angular.module('auth').factory('authenticationService', ['$injector', | ||||
|         .then(function authenticationSuccessful(data) { | ||||
|  | ||||
|             var currentToken = service.getCurrentToken(); | ||||
|             setAuthenticationResult(new AuthenticationResult(data)); | ||||
|  | ||||
|             // If a new token was received, ensure the old token is invalidated, | ||||
|             // if any, and notify listeners of the new token | ||||
| @@ -180,10 +179,16 @@ angular.module('auth').factory('authenticationService', ['$injector', | ||||
|                 } | ||||
|  | ||||
|                 // Notify of login and new token | ||||
|                 setAuthenticationResult(new AuthenticationResult(data)); | ||||
|                 $rootScope.$broadcast('guacLogin', data.authToken); | ||||
|  | ||||
|             } | ||||
|  | ||||
|             // Update cached authentication result, even if the token remains | ||||
|             // the same | ||||
|             else | ||||
|                 setAuthenticationResult(new AuthenticationResult(data)); | ||||
|  | ||||
|             // Authentication was successful | ||||
|             return data; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user