mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-05 23:53:21 +00:00
* Split jslib * Change hook to preinstall * Install gyp (ci) * Fix rebuild command * Review comments * Add tsconfig-paths-plugin to webpack.cli. * Bump jslib * Install old version of prebuild-install to bypass bug in pkg
23 lines
575 B
TypeScript
23 lines
575 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import {
|
|
CanActivate,
|
|
Router,
|
|
} from '@angular/router';
|
|
|
|
import { ApiKeyService } from 'jslib-common/abstractions/apiKey.service';
|
|
|
|
@Injectable()
|
|
export class LaunchGuardService implements CanActivate {
|
|
constructor(private apiKeyService: ApiKeyService, private router: Router) { }
|
|
|
|
async canActivate() {
|
|
const isAuthed = await this.apiKeyService.isAuthenticated();
|
|
if (!isAuthed) {
|
|
return true;
|
|
}
|
|
|
|
this.router.navigate(['/tabs/dashboard']);
|
|
return false;
|
|
}
|
|
}
|