mirror of
https://github.com/bitwarden/jslib
synced 2025-12-15 07:43:45 +00:00
Apply Prettier (#581)
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
CanActivate,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { Injectable } from "@angular/core";
|
||||
import { CanActivate, Router } from "@angular/router";
|
||||
|
||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||
import { VaultTimeoutService } from 'jslib-common/abstractions/vaultTimeout.service';
|
||||
import { StateService } from "jslib-common/abstractions/state.service";
|
||||
import { VaultTimeoutService } from "jslib-common/abstractions/vaultTimeout.service";
|
||||
|
||||
@Injectable()
|
||||
export class LockGuardService implements CanActivate {
|
||||
protected homepage = 'vault';
|
||||
constructor(private vaultTimeoutService: VaultTimeoutService, private router: Router,
|
||||
private stateService: StateService) { }
|
||||
protected homepage = "vault";
|
||||
constructor(
|
||||
private vaultTimeoutService: VaultTimeoutService,
|
||||
private router: Router,
|
||||
private stateService: StateService
|
||||
) {}
|
||||
|
||||
async canActivate() {
|
||||
if (!await this.stateService.getIsAuthenticated()) {
|
||||
this.router.navigate(['login']);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!await this.vaultTimeoutService.isLocked()) {
|
||||
this.router.navigate([this.homepage]);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
async canActivate() {
|
||||
if (!(await this.stateService.getIsAuthenticated())) {
|
||||
this.router.navigate(["login"]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(await this.vaultTimeoutService.isLocked())) {
|
||||
this.router.navigate([this.homepage]);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user