This commit is contained in:
Peter Maquiran
2022-12-21 14:53:01 +01:00
parent 978f2dff4b
commit 0c80a6d84d
2 changed files with 30 additions and 24 deletions
+5 -1
View File
@@ -23,7 +23,7 @@ export class InactivityGuard implements CanActivate {
console.log('hire inactinity!', state.url) console.log('hire inactinity!', state.url)
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if ((this.platform.is('desktop') || this.platform.is('mobileweb')) && (SessionStore?.user?.Inactivity) ) {
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){ if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
this.router.navigate(['/home/events']); this.router.navigate(['/home/events']);
} }
@@ -64,6 +64,7 @@ export class InactivityGuard implements CanActivate {
}//Mobile or Tablet without session }//Mobile or Tablet without session
else { else {
if((SessionStore?.user?.Inactivity)) {
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){ if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
this.router.navigate(['/home/events']); this.router.navigate(['/home/events']);
} }
@@ -89,6 +90,9 @@ export class InactivityGuard implements CanActivate {
return false return false
} }
}
} }
} }
+4 -2
View File
@@ -21,18 +21,20 @@ export class LoginGuard implements CanActivate {
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) { if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
// enter app
this.router.navigate(['/home/events']); this.router.navigate(['/home/events']);
return false return false
} else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && SessionStore.forceToLoginWithForceToLogInWithPassword && !this.platform.is('desktop') && !this.platform.is('mobileweb')) { } else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && SessionStore.forceToLoginWithForceToLogInWithPassword && !this.platform.is('desktop') && !this.platform.is('mobileweb')) {
// login with password while has pin
SessionStore.forceToLoginWithForceToLogInWithPassword = false SessionStore.forceToLoginWithForceToLogInWithPassword = false
return true return true
} else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin && !this.platform.is('desktop') && !this.platform.is('mobileweb') ) { } else if(SessionStore.exist && !this.platform.is('desktop') && !this.platform.is('mobileweb') ) {
// go to pin page
this.router.navigate(['/pin']); this.router.navigate(['/pin']);
return false return false
} else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && !this.platform.is('desktop') && !this.platform.is('mobileweb')) { } else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && !this.platform.is('desktop') && !this.platform.is('mobileweb')) {
this.router.navigate(['/inactivity']); this.router.navigate(['/inactivity']);
return false return false
} else { } else {
return true return true
} }