This commit is contained in:
tiago.kayaya
2021-09-06 12:14:38 +01:00
4 changed files with 11 additions and 4 deletions
+2 -2
View File
@@ -18,9 +18,9 @@ export class AuthGuard implements CanActivate {
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
if(!SessionStore.user.Inactivity) {
this.router.navigate(['/inactivity']);
this.router.navigate(['/']);
}
else if(window.location.pathname != '' && !SessionStore.exist) {
else if(!SessionStore.exist) {
this.router.navigate(['/']);
return false
} else {
+1
View File
@@ -17,6 +17,7 @@ export class LoginGuard implements CanActivate {
// console.log(SessionStore.exist, SessionStore.user.Inactivity, SessionStore.user.LoginPreference)
console.log(SessionStore.exist, SessionStore.user.Inactivity, SessionStore.user.LoginPreference)
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
this.router.navigate(['/home/events']);
return false
@@ -133,6 +133,11 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
}
};
this.checkRoutes();
// this.eventoaprovacaostore.resetmd([])
// this.eventoaprovacaostore.resetpr([])
}
ngDoCheck(): void {
@@ -158,7 +163,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.segmentVista = "listview";
}
else{
this.segmentVista = "boxview";
this.segmentVista = "boxview"
}
const pathname = window.location.pathname
+2 -1
View File
@@ -83,7 +83,7 @@ export class LoginPage implements OnInit {
if (attempt.UserId == SessionStore.user.UserId) {
await this.authService.SetSession(attempt, this.userattempt);
this.authService.loginChat(this.userattempt);
await this.authService.loginChat(this.userattempt);
this.getToken();
SessionStore.setInativity(true)
@@ -92,6 +92,7 @@ export class LoginPage implements OnInit {
SessionStore.delete()
window.localStorage.clear();
await this.authService.SetSession(attempt, this.userattempt);
await this.authService.loginChat(this.userattempt);
this.router.navigate(['/pin']);
}