mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +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,
|
||||
} from '@angular/router';
|
||||
|
||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||
import { LockService } from 'jslib/abstractions/lock.service';
|
||||
import { UserService } from 'jslib/abstractions/user.service';
|
||||
|
||||
@Injectable()
|
||||
export class UnauthGuardService implements CanActivate {
|
||||
constructor(private cryptoService: CryptoService, private userService: UserService,
|
||||
constructor(private lockService: LockService, private userService: UserService,
|
||||
private router: Router) { }
|
||||
|
||||
async canActivate() {
|
||||
const isAuthed = await this.userService.isAuthenticated();
|
||||
if (isAuthed) {
|
||||
const hasKey = await this.cryptoService.hasKey();
|
||||
if (!hasKey) {
|
||||
const locked = await this.lockService.isLocked();
|
||||
if (locked) {
|
||||
this.router.navigate(['lock']);
|
||||
} else {
|
||||
this.router.navigate(['vault']);
|
||||
|
Loading…
Reference in New Issue
Block a user