mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
Fix lockGuard logic (#384)
* Fix lockGuard logic * add missing return values
This commit is contained in:
@@ -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();
|
const isAuthed = await this.userService.isAuthenticated();
|
||||||
if (!locked) {
|
if (isAuthed) {
|
||||||
const isAuthed = await this.userService.isAuthenticated();
|
const locked = await this.vaultTimeoutService.isLocked();
|
||||||
if (!isAuthed) {
|
if (locked) {
|
||||||
this.router.navigate(['login']);
|
return true;
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate(['vault']);
|
this.router.navigate(['vault']);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
this.router.navigate(['']);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user