1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 19:23:52 +00:00

private mode component

This commit is contained in:
Kyle Spearrin
2018-04-13 22:08:24 -04:00
parent 31ddb97530
commit 4308947893
9 changed files with 62 additions and 10 deletions

View File

@@ -1,3 +1,5 @@
import { BrowserApi } from '../../browser/browserApi';
import { Injectable } from '@angular/core';
import {
CanActivate,
@@ -12,6 +14,11 @@ export class LaunchGuardService implements CanActivate {
constructor(private cryptoService: CryptoService, private userService: UserService, private router: Router) { }
async canActivate() {
if (BrowserApi.getBackgroundPage() == null) {
this.router.navigate(['private-mode']);
return false;
}
const isAuthed = await this.userService.isAuthenticated();
if (!isAuthed) {
return true;