aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_modals/login-modal/login-modal.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/app/_modals/login-modal/login-modal.component.ts')
-rw-r--r--frontend/src/app/_modals/login-modal/login-modal.component.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/frontend/src/app/_modals/login-modal/login-modal.component.ts b/frontend/src/app/_modals/login-modal/login-modal.component.ts
index b28d9799..f69e1cff 100644
--- a/frontend/src/app/_modals/login-modal/login-modal.component.ts
+++ b/frontend/src/app/_modals/login-modal/login-modal.component.ts
@@ -14,10 +14,13 @@ import {AfterViewInit, ElementRef} from '@angular/core';
export class LoginModalComponent implements OnInit {
@ViewChild('closeButton') closeButton?: ElementRef;
+ @ViewChild('pass') passwordInput!: ElementRef;
username: string = '';
password: string = '';
+ passwordShown: boolean = false;
+
wrongCreds: boolean = false;
constructor(
@@ -37,6 +40,8 @@ export class LoginModalComponent implements OnInit {
if (response == "Username doesn't exist" || response == "Wrong password") {
this.wrongCreds = true;
this.password = '';
+ this.passwordShown = false;
+ this.passwordInput.nativeElement.type = "password";
}
else {
this.authService.authenticate(response);
@@ -57,4 +62,13 @@ export class LoginModalComponent implements OnInit {
this.username = '';
this.password = '';
}
+
+ togglePasswordShown() {
+ this.passwordShown = !this.passwordShown;
+
+ if (this.passwordShown)
+ this.passwordInput.nativeElement.type = "text";
+ else
+ this.passwordInput.nativeElement.type = "password";
+ }
}