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 committed 2015-06-08 14:33:43 -07:00
1 parent 7a3503a40e
commit 85dae9e52a
1 file changed
+5 -2
@@ -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