diff --git a/angular/src/components/lock.component.ts b/angular/src/components/lock.component.ts index 50cc91c6..9ef67b90 100644 --- a/angular/src/components/lock.component.ts +++ b/angular/src/components/lock.component.ts @@ -54,25 +54,6 @@ export class LockComponent implements OnInit { }); } - private async load() { - this.pinSet = await this.vaultTimeoutService.isPinLockSet(); - this.pinLock = (this.pinSet[0] && (await this.stateService.getEncryptedPinProtected()) != null) || this.pinSet[1]; - this.supportsBiometric = await this.platformUtilsService.supportsBiometric(); - this.biometricLock = await this.vaultTimeoutService.isBiometricLockSet() && - (await this.cryptoService.hasKeyStored(KeySuffixOptions.Biometric) || !this.platformUtilsService.supportsSecureStorage()); - this.biometricText = await this.stateService.getBiometricText(); - this.email = await this.stateService.getEmail(); - - // Users with key connector and without biometric or pin has no MP to unlock using - if (await this.keyConnectorService.getUsesKeyConnector() && !(this.biometricLock || this.pinLock)) { - await this.vaultTimeoutService.logOut(); - } - - const webVaultUrl = this.environmentService.getWebVaultUrl(); - const vaultUrl = webVaultUrl === 'https://vault.bitwarden.com' ? 'https://bitwarden.com' : webVaultUrl; - this.webVaultHostname = Utils.getHostname(vaultUrl); - } - async submit() { if (this.pinLock && (this.pin == null || this.pin === '')) { this.platformUtilsService.showToast('error', this.i18nService.t('errorOccurred'), @@ -204,4 +185,24 @@ export class LockComponent implements OnInit { this.router.navigate([this.successRoute]); } } + + private async load() { + this.pinSet = await this.vaultTimeoutService.isPinLockSet(); + this.pinLock = (this.pinSet[0] && (await this.stateService.getEncryptedPinProtected()) != null) || this.pinSet[1]; + this.supportsBiometric = await this.platformUtilsService.supportsBiometric(); + this.biometricLock = await this.vaultTimeoutService.isBiometricLockSet() && + (await this.cryptoService.hasKeyStored(KeySuffixOptions.Biometric) || !this.platformUtilsService.supportsSecureStorage()); + this.biometricText = await this.stateService.getBiometricText(); + this.email = await this.stateService.getEmail(); + + // Users with key connector and without biometric or pin has no MP to unlock using + if (await this.keyConnectorService.getUsesKeyConnector() && !(this.biometricLock || this.pinLock)) { + await this.vaultTimeoutService.logOut(); + } + + const webVaultUrl = this.environmentService.getWebVaultUrl(); + const vaultUrl = webVaultUrl === 'https://vault.bitwarden.com' ? 'https://bitwarden.com' : webVaultUrl; + this.webVaultHostname = Utils.getHostname(vaultUrl); + } + } diff --git a/common/src/services/vaultTimeout.service.ts b/common/src/services/vaultTimeout.service.ts index 8e1d3b1d..dfbe06bf 100644 --- a/common/src/services/vaultTimeout.service.ts +++ b/common/src/services/vaultTimeout.service.ts @@ -158,7 +158,7 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction { private async shouldLock(userId: string): Promise { if (await this.isLoggedOut(userId)) { - return false;; + return false; } if (await this.isLocked(userId)) {