This commit is contained in:
Peter Maquiran
2021-08-30 11:41:21 +01:00
parent 970f63da75
commit 6a3ef5b14e
4 changed files with 7 additions and 6 deletions
+1 -2
View File
@@ -16,8 +16,7 @@ export class InactivityGuard implements CanActivate {
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin) {
if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
return true
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
return true
+1
View File
@@ -82,6 +82,7 @@ export class HomePage implements OnInit {
window['platform'] = platform
window['inactivity/function'] = () => {
if(window.location.pathname != '/inactivity') {
const pathname = window.location.pathname
+3 -4
View File
@@ -212,12 +212,11 @@ export class ProfilePage implements OnInit {
}
logout() {
SessionStore.setInativity(false)
this.router.navigateByUrl('/inactivity');
window['inactivity/function']()
setTimeout(() => {
this.router.navigateByUrl('/', { replaceUrl: true });
this.router.navigate(['/inactivity']);
}, 100)
}
@@ -79,6 +79,7 @@ export class InactivityPage implements OnInit {
await this.authService.SetSession(attempt, this.userattempt);
await this.authService.loginChat(this.userattempt);
await this.getToken();
SessionStore.setInativity(true)
this.goback()
} else {
@@ -142,6 +143,7 @@ export class InactivityPage implements OnInit {
goback() {
const pathName = this.SessionStore.user.UrlBeforeInactivity
alert(pathName)
this.router.navigate([pathName]);
}