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
+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
}
}