GUAC-1176: Clear passwords if credentials are rejected for any reason (even client error). Flag generic login error only for specifically invalid credentials.

This commit is contained in:
Michael Jumper
2015-06-03 00:35:10 -07:00
parent 7a3503a40e
commit 85dae9e52a

View File

@@ -123,9 +123,12 @@ angular.module('login').directive('guacLogin', [function guacLogin() {
// Reset upon failure
['catch'](function loginFailed(error) {
// Clear out passwords and flag error if credentials are invalid
if (error.type === Error.Type.INVALID_CREDENTIALS) {
// Flag generic error for invalid login
if (error.type === Error.Type.INVALID_CREDENTIALS)
$scope.loginError = true;
// Clear out passwords if the credentials were rejected for any reason
if (error.type !== Error.Type.INSUFFICIENT_CREDENTIALS) {
angular.forEach($scope.form, function clearEnteredValueIfPassword(field) {
// Remove entered value only if field is a password field