feat(login): Add button to discover password

This commit is contained in:
smizrahi
2022-11-09 15:40:29 +01:00
parent 8bfc3e4205
commit 7bfa900ae1
4 changed files with 16 additions and 4 deletions

View File

@@ -50,7 +50,8 @@
<md-input-container class="md-block">
<label><var:string label:value="Password"/></label>
<md-icon>email</md-icon>
<input type="password" ng-model="app.creds.password" ng-required="true"/>
<input id="passwordField" type="password" ng-model="app.creds.password" ng-required="true"/>
<md-icon id="password-visibility-icon" ng-click="app.changePasswordVisibility()">visibility</md-icon>
</md-input-container>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -29,7 +29,7 @@
this.verificationCodePattern = '\\d{6}';
// Password policy - change expired password
this.passwords = { newPassword: null, newPasswordConfirmation: null, oldPassword: null };
this.passwords = { newPassword: null, newPasswordConfirmation: null, oldPassword: null, visible: false };
// Password recovery
this.passwordRecovery = {
@@ -317,6 +317,17 @@
}
};
this.changePasswordVisibility = function () {
this.passwords.visible = !this.passwords.visible;
var field = document.getElementById("passwordField");
if (this.passwords.visible) {
field.type = "text";
document.getElementById("password-visibility-icon").innerHTML = 'visibility_off';
} else {
field.type = "password";
document.getElementById("password-visibility-icon").innerHTML = 'visibility';
}
}
}
angular