add inactivity

This commit is contained in:
Peter Maquiran
2021-08-27 17:11:05 +01:00
parent 2e4458283a
commit 81b7f4820b
9 changed files with 55 additions and 84 deletions
@@ -1,9 +1,7 @@
<ion-content class="text-white">
<div class="main-wrapper">
<div class="wrapper" *ngIf="SessionStore.user.LoginPreference == 'Password' && SessionStore.hasPin || SessionStore.user.LoginPreference == null && SessionStore.hasPin ">
<div class="wrapper" *ngIf="SessionStore.user.LoginPreference == 'Password' && SessionStore.hasPin || SessionStore.user.LoginPreference == null && SessionStore.hasPin || SessionStore.user.LoginPreference == 'None' && SessionStore.hasPin || enterWithPassword">
<div class="bg-1 d-flex justify-center align-center">
<div class="bg-2 d-flex justify-center align-center">
@@ -35,7 +33,7 @@
</div>
</div>
<div class="main-content d-flex flex-column height-100 width" *ngIf="!SessionStore.hasPin || SessionStore.hasPin && SessionStore.user.LoginPreference == 'Pin' " >
<div class="main-content d-flex flex-column height-100 width" *ngIf="!SessionStore.hasPin || SessionStore.hasPin && SessionStore.user.LoginPreference == 'Pin' && !enterWithPassword " >
<div class="div-top-header">
@@ -49,7 +47,6 @@
<div *ngIf="SessionStore.hasPin" class="title">Digite o PIN</div>
<div *ngIf="!SessionStore.hasPin" class="title">Digite o novo PIN</div>
<div class="terminal">
<div class="d-flex pt-25 align-center justify-center pin-4">
<div class="dot" [class.dot-active]="code.length >= 1"></div>
@@ -76,7 +73,7 @@
</div>
<div *ngIf="SessionStore.hasPin" class="voltar d-flex align-center justify-center pt-25 clear" >
<div *ngIf="SessionStore.hasPin" class="voltar d-flex align-center justify-center pt-25 clear" (click)="enterWithPasswordButton()" >
Entrar com senha
</div>
+14 -4
View File
@@ -22,6 +22,7 @@ export class InactivityPage implements OnInit {
code = []
setPin = false
SessionStore = SessionStore
enterWithPassword = false
constructor(
private notificatinsservice: NotificationsService,
@@ -78,14 +79,14 @@ export class InactivityPage implements OnInit {
await this.authService.SetSession(attempt, this.userattempt);
await this.authService.loginChat(this.userattempt);
await this.getToken();
this.router.navigate(['/home/events']);
this.goback()
} else {
SessionStore.delete()
await this.authService.SetSession(attempt, this.userattempt);
}
this.enterWithPassword = false
}
}
else {
@@ -129,7 +130,7 @@ export class InactivityPage implements OnInit {
if( SessionStore.validatePin(code)) {
this.router.navigate(['/home/events']);
this.goback()
this.clearCode()
} else {
this.toastService.badRequest('Pin incorreto')
@@ -138,6 +139,11 @@ export class InactivityPage implements OnInit {
}
goback() {
const pathName = this.SessionStore.user.UrlBeforeInactivity
this.router.navigate([pathName]);
}
storePin() {
const code = this.code.join('')
@@ -148,4 +154,8 @@ export class InactivityPage implements OnInit {
}
enterWithPasswordButton() {
this.enterWithPassword = true
}
}