mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
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:
@@ -123,9 +123,12 @@ angular.module('login').directive('guacLogin', [function guacLogin() {
|
|||||||
// Reset upon failure
|
// Reset upon failure
|
||||||
['catch'](function loginFailed(error) {
|
['catch'](function loginFailed(error) {
|
||||||
|
|
||||||
// Clear out passwords and flag error if credentials are invalid
|
// Flag generic error for invalid login
|
||||||
if (error.type === Error.Type.INVALID_CREDENTIALS) {
|
if (error.type === Error.Type.INVALID_CREDENTIALS)
|
||||||
$scope.loginError = true;
|
$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) {
|
angular.forEach($scope.form, function clearEnteredValueIfPassword(field) {
|
||||||
|
|
||||||
// Remove entered value only if field is a password field
|
// Remove entered value only if field is a password field
|
||||||
|
Reference in New Issue
Block a user