mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
save
This commit is contained in:
@@ -21,17 +21,14 @@ export class AuthGuard implements CanActivate {
|
||||
canActivate(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
console.log('hire!', state.url)
|
||||
|
||||
// if user not active
|
||||
if(!SessionStore.user.Inactivity) {
|
||||
console.log(' goto login /')
|
||||
this.router.navigate(['/']);
|
||||
return false
|
||||
}
|
||||
// if session doesn't exit
|
||||
else if(!SessionStore.exist) {
|
||||
console.log(' goto /')
|
||||
this.router.navigate(['/']);
|
||||
return false
|
||||
} else {
|
||||
@@ -72,7 +69,6 @@ export class AuthGuard implements CanActivate {
|
||||
}
|
||||
} else if (pathname.startsWith('/home/events')) {
|
||||
if(SessionStore.user.OwnerCalendars.length >= 1 || this.p.userPermission([this.p.permissionList.Gabinete.access])) {
|
||||
console.log('go /home/events')
|
||||
return true
|
||||
} else {
|
||||
this.router.navigate(['/login']);
|
||||
|
||||
Reference in New Issue
Block a user