move to lock service is locked

This commit is contained in:
Kyle Spearrin 2019-02-13 21:55:11 -05:00
parent 259725882a
commit 961954364a
2 changed files with 5 additions and 5 deletions

2
jslib

@ -1 +1 @@
Subproject commit 76c53bc641bc2385b601921f52be105bb539ffe6
Subproject commit 0bdbfd79846e54e1b28a7fd116d8ffa533de4219

View File

@ -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']);