GUACAMOLE-197: Handle all non-username fields identically.

This commit is contained in:
Nick Couchman
2018-01-30 09:50:21 -05:00
parent 4a57012f9d
commit 037913ac73

View File

@@ -171,12 +171,8 @@ angular.module('login').directive('guacLogin', [function guacLogin() {
// Clear all remaining fields that are not username fields // Clear all remaining fields that are not username fields
angular.forEach($scope.remainingFields, function clearEnteredValueIfPassword(field) { angular.forEach($scope.remainingFields, function clearEnteredValueIfPassword(field) {
// Remove entered value only if field is a password field // If field is not username field, delete it.
if (field.type === Field.Type.PASSWORD && field.name in $scope.enteredValues) if (field.type !== Field.Type.USERNAME && field.name in $scope.enteredValues)
$scope.enteredValues[field.name] = '';
// If field is not username field and not password field, delete it.
else if (field.type !== Field.Type.USERNAME && field.name in $scope.enteredValues)
delete $scope.enteredValues[field.name]; delete $scope.enteredValues[field.name];
}); });