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, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree { 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 return true
} else if(SessionStore.exist && !SessionStore.user.Inactivity) { } else if(SessionStore.exist && !SessionStore.user.Inactivity) {
return true return true
+1
View File
@@ -82,6 +82,7 @@ export class HomePage implements OnInit {
window['platform'] = platform window['platform'] = platform
window['inactivity/function'] = () => { window['inactivity/function'] = () => {
if(window.location.pathname != '/inactivity') { if(window.location.pathname != '/inactivity') {
const pathname = window.location.pathname const pathname = window.location.pathname
+2 -3
View File
@@ -212,12 +212,11 @@ export class ProfilePage implements OnInit {
} }
logout() { logout() {
SessionStore.setInativity(false) SessionStore.setInativity(false)
this.router.navigateByUrl('/inactivity'); window['inactivity/function']()
setTimeout(() => { setTimeout(() => {
this.router.navigateByUrl('/', { replaceUrl: true }); this.router.navigate(['/inactivity']);
}, 100) }, 100)
} }
@@ -79,6 +79,7 @@ export class InactivityPage implements OnInit {
await this.authService.SetSession(attempt, this.userattempt); await this.authService.SetSession(attempt, this.userattempt);
await this.authService.loginChat(this.userattempt); await this.authService.loginChat(this.userattempt);
await this.getToken(); await this.getToken();
SessionStore.setInativity(true)
this.goback() this.goback()
} else { } else {
@@ -142,6 +143,7 @@ export class InactivityPage implements OnInit {
goback() { goback() {
const pathName = this.SessionStore.user.UrlBeforeInactivity const pathName = this.SessionStore.user.UrlBeforeInactivity
alert(pathName)
this.router.navigate([pathName]); this.router.navigate([pathName]);
} }