mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-03 18:28:13 +01:00
move to lock service is locked
This commit is contained in:
parent
259725882a
commit
961954364a
2
jslib
2
jslib
@ -1 +1 @@
|
|||||||
Subproject commit 76c53bc641bc2385b601921f52be105bb539ffe6
|
Subproject commit 0bdbfd79846e54e1b28a7fd116d8ffa533de4219
|
@ -4,19 +4,19 @@ import {
|
|||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
import { LockService } from 'jslib/abstractions/lock.service';
|
||||||
import { UserService } from 'jslib/abstractions/user.service';
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class UnauthGuardService implements CanActivate {
|
export class UnauthGuardService implements CanActivate {
|
||||||
constructor(private cryptoService: CryptoService, private userService: UserService,
|
constructor(private lockService: LockService, private userService: UserService,
|
||||||
private router: Router) { }
|
private router: Router) { }
|
||||||
|
|
||||||
async canActivate() {
|
async canActivate() {
|
||||||
const isAuthed = await this.userService.isAuthenticated();
|
const isAuthed = await this.userService.isAuthenticated();
|
||||||
if (isAuthed) {
|
if (isAuthed) {
|
||||||
const hasKey = await this.cryptoService.hasKey();
|
const locked = await this.lockService.isLocked();
|
||||||
if (!hasKey) {
|
if (locked) {
|
||||||
this.router.navigate(['lock']);
|
this.router.navigate(['lock']);
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate(['vault']);
|
this.router.navigate(['vault']);
|
||||||
|
Loading…
Reference in New Issue
Block a user