Fix lockGuard logic (#384)
* Fix lockGuard logic * add missing return values
This commit is contained in:
parent
3ab710389b
commit
5f1ad85dd1
|
@ -13,17 +13,18 @@ export class LockGuardService implements CanActivate {
|
||||||
private router: Router) { }
|
private router: Router) { }
|
||||||
|
|
||||||
async canActivate() {
|
async canActivate() {
|
||||||
const locked = await this.vaultTimeoutService.isLocked();
|
|
||||||
if (!locked) {
|
|
||||||
const isAuthed = await this.userService.isAuthenticated();
|
const isAuthed = await this.userService.isAuthenticated();
|
||||||
if (!isAuthed) {
|
if (isAuthed) {
|
||||||
this.router.navigate(['login']);
|
const locked = await this.vaultTimeoutService.isLocked();
|
||||||
|
if (locked) {
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate(['vault']);
|
this.router.navigate(['vault']);
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
this.router.navigate(['']);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue