1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

Add setting for disabling auto prompt of biometrics (#873)

* Add setting for disabling auto prompt of biometrics

* Ensure window is visible before prompting for biometrics
This commit is contained in:
Oscar Hinton
2021-05-06 20:19:48 +02:00
committed by GitHub
parent a712917f47
commit af5898a001
5 changed files with 45 additions and 3 deletions

View File

@@ -50,6 +50,8 @@ export class SettingsComponent implements OnInit {
supportsBiometric: boolean;
biometric: boolean;
biometricText: string;
noAutoPromptBiometrics: boolean;
noAutoPromptBiometricsText: string;
alwaysShowDock: boolean;
showAlwaysShowDock: boolean = false;
openAtLogin: boolean;
@@ -162,6 +164,8 @@ export class SettingsComponent implements OnInit {
this.supportsBiometric = await this.platformUtilsService.supportsBiometric();
this.biometric = await this.vaultTimeoutService.isBiometricLockSet();
this.biometricText = await this.storageService.get<string>(ConstantsService.biometricText);
this.noAutoPromptBiometrics = await this.storageService.get<boolean>(ElectronConstants.noAutoPromptBiometrics);
this.noAutoPromptBiometricsText = await this.storageService.get<string>(ElectronConstants.noAutoPromptBiometricsText);
this.alwaysShowDock = await this.storageService.get<boolean>(ElectronConstants.alwaysShowDock);
this.showAlwaysShowDock = this.platformUtilsService.getDevice() === DeviceType.MacOsDesktop;
this.openAtLogin = await this.storageService.get<boolean>(ElectronConstants.openAtLogin);
@@ -255,11 +259,25 @@ export class SettingsComponent implements OnInit {
await this.storageService.save(ConstantsService.biometricUnlockKey, true);
} else {
await this.storageService.remove(ConstantsService.biometricUnlockKey);
await this.storageService.remove(ElectronConstants.noAutoPromptBiometrics);
this.noAutoPromptBiometrics = false;
}
this.vaultTimeoutService.biometricLocked = false;
await this.cryptoService.toggleKey();
}
async updateNoAutoPromptBiometrics() {
if (!this.biometric) {
this.noAutoPromptBiometrics = false;
}
if (this.noAutoPromptBiometrics) {
await this.storageService.save(ElectronConstants.noAutoPromptBiometrics, true);
} else {
await this.storageService.remove(ElectronConstants.noAutoPromptBiometrics);
}
}
async saveFavicons() {
await this.storageService.save(ConstantsService.disableFaviconKey, this.disableFavicons);
await this.stateService.save(ConstantsService.disableFaviconKey, this.disableFavicons);