mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
feature/gabinete-search
This commit is contained in:
@@ -23,18 +23,13 @@ export class AuthGuard implements CanActivate {
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
|
||||
console.log('hire auth!', state.url)
|
||||
|
||||
// if user not active or no session
|
||||
if(!SessionStore.user.Inactivity || !SessionStore.exist) {
|
||||
|
||||
// console.log('no session', !SessionStore.user.Inactivity, !SessionStore.exist)
|
||||
// console.log(SessionStore.user)
|
||||
if(SessionStore.user.LoginPreference == 'Pin') {
|
||||
this.router.navigate(['/pin']);
|
||||
} else {
|
||||
this.router.navigate(['/']);
|
||||
// console.log('goto login page')
|
||||
}
|
||||
|
||||
return false
|
||||
@@ -48,7 +43,6 @@ export class AuthGuard implements CanActivate {
|
||||
return true;
|
||||
} else {
|
||||
this.router.navigate(['/login']);
|
||||
console.log('£1')
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,7 +53,6 @@ export class AuthGuard implements CanActivate {
|
||||
return true;
|
||||
} else {
|
||||
this.router.navigate(['/login']);
|
||||
console.log('£2')
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -67,8 +60,6 @@ export class AuthGuard implements CanActivate {
|
||||
if(this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||
return true;
|
||||
} else {
|
||||
console.log("no access to chat")
|
||||
console.log('£3')
|
||||
this.router.navigate(['/login']);
|
||||
return false;
|
||||
}
|
||||
@@ -76,7 +67,6 @@ export class AuthGuard implements CanActivate {
|
||||
if(this.p.userPermission(this.p.permissionList.Actions.access)) {
|
||||
return true
|
||||
} else {
|
||||
console.log('£4')
|
||||
this.router.navigate(['/login']);
|
||||
return false
|
||||
}
|
||||
@@ -84,18 +74,13 @@ export class AuthGuard implements CanActivate {
|
||||
if(SessionStore.user.OwnerCalendars.length >= 1 || this.p.userPermission([this.p.permissionList.Gabinete.access])) {
|
||||
return true
|
||||
} else {
|
||||
console.log('£5')
|
||||
this.router.navigate(['/login']);
|
||||
return false
|
||||
}
|
||||
} else if (pathname == '/') {
|
||||
console.log('£6')
|
||||
this.router.navigate(['/login']);
|
||||
console.log('no path')
|
||||
return false
|
||||
} else {
|
||||
console.log('£7')
|
||||
console.log('pathname not match')
|
||||
this.router.navigate(['/login']);
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user