mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 17:13:21 +00:00 
			
		
		
		
	GUACAMOLE-197: Handle extra login fields when dealing with failed authentication.
This commit is contained in:
		| @@ -66,6 +66,7 @@ angular.module('login').directive('guacLogin', [function guacLogin() { | ||||
|         var Field = $injector.get('Field'); | ||||
|  | ||||
|         // Required services | ||||
|         var $log                  = $injector.get('$log'); | ||||
|         var $route                = $injector.get('$route'); | ||||
|         var authenticationService = $injector.get('authenticationService'); | ||||
|  | ||||
| @@ -168,13 +169,17 @@ angular.module('login').directive('guacLogin', [function guacLogin() { | ||||
|                     else | ||||
|                         $scope.loginError = error.translatableMessage; | ||||
|  | ||||
|                     // Clear all visible password fields | ||||
|                     // Clear all remaining fields that are not username fields | ||||
|                     angular.forEach($scope.remainingFields, function clearEnteredValueIfPassword(field) { | ||||
|  | ||||
|                         // Remove entered value only if field is a password field | ||||
|                         if (field.type === Field.Type.PASSWORD && field.name in $scope.enteredValues) | ||||
|                         if (field.type === Field.Type.PASSWORD) | ||||
|                             $scope.enteredValues[field.name] = ''; | ||||
|  | ||||
|                         // If field is not username field and not password field, delete it. | ||||
|                         else if (field.type !== Field.Type.USERNAME) | ||||
|                             delete $scope.enteredValues[field.name]; | ||||
|  | ||||
|                     }); | ||||
|                 } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user