mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
check notification and inactivity
This commit is contained in:
@@ -14,9 +14,6 @@ export class AuthGuard implements CanActivate {
|
||||
constructor(
|
||||
private router:Router,
|
||||
public p: PermissionService,
|
||||
private RouteService: RouteService,
|
||||
private FirstEnterService: FirstEnterService,
|
||||
private alertController: AlertController,
|
||||
){}
|
||||
|
||||
canActivate(
|
||||
@@ -31,7 +28,7 @@ export class AuthGuard implements CanActivate {
|
||||
} else {
|
||||
this.router.navigate(['/']);
|
||||
}
|
||||
|
||||
|
||||
return false
|
||||
} else {
|
||||
|
||||
@@ -39,15 +36,15 @@ export class AuthGuard implements CanActivate {
|
||||
|
||||
if(pathname.startsWith('/home/agenda')) {
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access)) {
|
||||
|
||||
|
||||
return true;
|
||||
} else {
|
||||
this.router.navigate(['/login']);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
} else if ( pathname.startsWith('/home/gabinete-digital')) {
|
||||
|
||||
|
||||
|
||||
if(this.p.userPermission(this.p.permissionList.Gabinete.access)) {
|
||||
return true;
|
||||
|
||||
@@ -10,17 +10,16 @@ import { FirstEnterService } from 'src/app/services/first-enter.service'
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LoginGuard implements CanActivate {
|
||||
constructor(
|
||||
private router:Router,
|
||||
constructor(
|
||||
private router:Router,
|
||||
private platform: Platform,
|
||||
private RouteService: RouteService,
|
||||
private FirstEnterService: FirstEnterService ) {
|
||||
|
||||
}
|
||||
canActivate(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
|
||||
|
||||
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
|
||||
// enter app
|
||||
this.FirstEnterService.enter()
|
||||
|
||||
Reference in New Issue
Block a user