1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 02:03:39 +00:00

soft locking with protected pin

This commit is contained in:
Kyle Spearrin
2019-02-13 21:36:36 -05:00
parent 76c53bc641
commit 0bdbfd7984
6 changed files with 79 additions and 20 deletions

View File

@@ -4,13 +4,13 @@ import {
Router,
} from '@angular/router';
import { CryptoService } from '../../abstractions/crypto.service';
import { LockService } from '../../abstractions/lock.service';
import { MessagingService } from '../../abstractions/messaging.service';
import { UserService } from '../../abstractions/user.service';
@Injectable()
export class AuthGuardService implements CanActivate {
constructor(private cryptoService: CryptoService, private userService: UserService, private router: Router,
constructor(private lockService: LockService, private userService: UserService, private router: Router,
private messagingService: MessagingService) { }
async canActivate() {
@@ -20,8 +20,8 @@ export class AuthGuardService implements CanActivate {
return false;
}
const hasKey = await this.cryptoService.hasKey();
if (!hasKey) {
const locked = await this.lockService.isLocked();
if (locked) {
this.router.navigate(['lock']);
return false;
}