diff --git a/src/app/pages/login/login.page.html b/src/app/pages/login/login.page.html index 59c10d793..ba6b71c1c 100644 --- a/src/app/pages/login/login.page.html +++ b/src/app/pages/login/login.page.html @@ -16,17 +16,17 @@

Inicie a sessão

-

Nome de utilizador

+

Email

Palavra-passe

- +
-
+

Uma iniciativa do Gabinete do Presidente da República

@@ -40,7 +40,7 @@ - +
Digite o PIN Digite o novo PIN @@ -52,25 +52,25 @@
- +
1
2
3
- +
4
5
6
- +
7
8
9
- +
0
- +
- +
Entrar com senha
@@ -81,8 +81,8 @@ - + - \ No newline at end of file + diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 3d887c338..0cfbd7b86 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -34,7 +34,7 @@ export class LoginPage implements OnInit { private toastService: ToastService, public alertController: AlertController, private localstoreService: LocalstoreService - ) { + ) { } ngOnInit() { @@ -49,13 +49,13 @@ export class LoginPage implements OnInit { // this.router.navigate(['/home/events']); } - let userData = this.localstoreService.get('UserData', {}) - + let userData = this.localstoreService.get('UserData', {}) + const loginPreference = userData?.loginPreference const pin = userData?.PIN if (pin) { - this.hasPin = true + this.hasPin = true } else { this.hasPin = false } @@ -74,7 +74,7 @@ export class LoginPage implements OnInit { this.username.trim().length > 0 ); } - + validatePassword() { return ( this.password.trim().length > 0 @@ -125,7 +125,7 @@ export class LoginPage implements OnInit { BasicAuthKey: "" } let attempt = await this.authService.login(this.userattempt); - + if (attempt) { this.authService.loginChat(this.userattempt); this.getToken(); @@ -139,7 +139,7 @@ export class LoginPage implements OnInit { } } else { - this.toastService.badRequest('O nome de utilizador e/ou palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar'); + this.toastService.badRequest('O email e/ou palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar'); } } else { @@ -152,16 +152,16 @@ export class LoginPage implements OnInit { } setCode(code: string) { - + if(this.code.length < 4) { this.code.push(code) } if(this.code.length == 4) { - + const code = this.code.join('') const encrypted = crypto.SHA1(code) - + if(!this.hasPin) { // alert('storePin') this.storePin() @@ -177,15 +177,15 @@ export class LoginPage implements OnInit { } pinLogin() { - + const code = this.code.join('') const encrypted = crypto.SHA1(code) - + let userData = this.localstoreService.get('UserData', {}) const pin = userData?.PIN //if( encrypted == pin) { - + if( encrypted == this.localstoreService.get('UserData', false)) { //this.toastService.successMessage() @@ -201,19 +201,19 @@ export class LoginPage implements OnInit { const code = this.code.join('') const encrypted = crypto.SHA1(code) - let userData: Object = this.localstoreService.get('UserData', {}) + let userData: Object = this.localstoreService.get('UserData', {}) userData['PIN'] = encrypted userData['loginPreference'] = 'none' - - this.localstoreService.set('UserData', userData) + + this.localstoreService.set('UserData', userData) - this.localstoreService.set('PIN', encrypted) + this.localstoreService.set('PIN', encrypted) this.router.navigate(['/home/events']); - + } -} \ No newline at end of file +}