1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

Fix lockGuard logic (#384)

* Fix lockGuard logic

* add missing return values
This commit is contained in:
Thomas Rittson 2021-05-20 21:05:17 +10:00 committed by GitHub
parent 3ab710389b
commit 5f1ad85dd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,17 +13,18 @@ export class LockGuardService implements CanActivate {
private router: Router) { }
async canActivate() {
const locked = await this.vaultTimeoutService.isLocked();
if (!locked) {
const isAuthed = await this.userService.isAuthenticated();
if (!isAuthed) {
this.router.navigate(['login']);
if (isAuthed) {
const locked = await this.vaultTimeoutService.isLocked();
if (locked) {
return true;
} else {
this.router.navigate(['vault']);
}
return false;
}
}
return true;
this.router.navigate(['']);
return false;
}
}