mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
Allow the lock screen to access the environmentService. (#42)
This commit is contained in:
@@ -2,6 +2,7 @@ import { OnInit } from '@angular/core';
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { CryptoService } from '../../abstractions/crypto.service';
|
import { CryptoService } from '../../abstractions/crypto.service';
|
||||||
|
import { EnvironmentService } from '../../abstractions/environment.service';
|
||||||
import { I18nService } from '../../abstractions/i18n.service';
|
import { I18nService } from '../../abstractions/i18n.service';
|
||||||
import { LockService } from '../../abstractions/lock.service';
|
import { LockService } from '../../abstractions/lock.service';
|
||||||
import { MessagingService } from '../../abstractions/messaging.service';
|
import { MessagingService } from '../../abstractions/messaging.service';
|
||||||
@@ -20,6 +21,7 @@ export class LockComponent implements OnInit {
|
|||||||
showPassword: boolean = false;
|
showPassword: boolean = false;
|
||||||
email: string;
|
email: string;
|
||||||
pinLock: boolean = false;
|
pinLock: boolean = false;
|
||||||
|
webVaultHostname: string = '';
|
||||||
|
|
||||||
protected successRoute: string = 'vault';
|
protected successRoute: string = 'vault';
|
||||||
protected onSuccessfulSubmit: () => void;
|
protected onSuccessfulSubmit: () => void;
|
||||||
@@ -30,13 +32,15 @@ export class LockComponent implements OnInit {
|
|||||||
constructor(protected router: Router, protected i18nService: I18nService,
|
constructor(protected router: Router, protected i18nService: I18nService,
|
||||||
protected platformUtilsService: PlatformUtilsService, protected messagingService: MessagingService,
|
protected platformUtilsService: PlatformUtilsService, protected messagingService: MessagingService,
|
||||||
protected userService: UserService, protected cryptoService: CryptoService,
|
protected userService: UserService, protected cryptoService: CryptoService,
|
||||||
protected storageService: StorageService, protected lockService: LockService) { }
|
protected storageService: StorageService, protected lockService: LockService,
|
||||||
|
protected environmentService: EnvironmentService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.pinSet = await this.lockService.isPinLockSet();
|
this.pinSet = await this.lockService.isPinLockSet();
|
||||||
const hasKey = await this.cryptoService.hasKey();
|
const hasKey = await this.cryptoService.hasKey();
|
||||||
this.pinLock = (this.pinSet[0] && hasKey) || this.pinSet[1];
|
this.pinLock = (this.pinSet[0] && hasKey) || this.pinSet[1];
|
||||||
this.email = await this.userService.getEmail();
|
this.email = await this.userService.getEmail();
|
||||||
|
this.webVaultHostname = await new URL(this.environmentService.getWebVaultUrl()).hostname;
|
||||||
}
|
}
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
|
|||||||
Reference in New Issue
Block a user