mirror of
https://github.com/bitwarden/browser
synced 2026-02-05 19:23:19 +00:00
Invert setting
This commit is contained in:
@@ -142,7 +142,7 @@ impl super::BiometricTrait for BiometricLockSystem {
|
||||
}
|
||||
|
||||
async fn unlock(&self, user_id: &str, _hwnd: Vec<u8>) -> Result<Vec<u8>> {
|
||||
// Allow restoring focus to the previous window (broweser)
|
||||
// Allow restoring focus to the previous window (browser)
|
||||
let previous_active_window = super::windows_focus::get_active_window();
|
||||
let _focus_scopeguard = scopeguard::guard((), |_| {
|
||||
if let Some(hwnd) = previous_active_window {
|
||||
|
||||
@@ -83,13 +83,13 @@
|
||||
</div>
|
||||
<div class="form-group" *ngIf="this.form.value.biometric && this.isWindows">
|
||||
<div class="checkbox form-group-child">
|
||||
<label for="allowBiometricUnlockOnAppRestart">
|
||||
<label for="requireMasterPasswordOnAppRestart">
|
||||
<input
|
||||
id="allowBiometricUnlockOnAppRestart"
|
||||
id="requireMasterPasswordOnAppRestart"
|
||||
type="checkbox"
|
||||
formControlName="allowBiometricUnlockOnAppRestart"
|
||||
formControlName="requireMasterPasswordOnAppRestart"
|
||||
/>
|
||||
{{ "allowBiometricUnlockOnAppRestart" | i18n }}
|
||||
{{ "requireMasterPasswordOnAppRestart" | i18n }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -136,7 +136,7 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||
vaultTimeoutAction: [VaultTimeoutAction.Lock],
|
||||
pin: [null as boolean | null],
|
||||
biometric: false,
|
||||
allowBiometricUnlockOnAppRestart: false,
|
||||
requireMasterPasswordOnAppRestart: true,
|
||||
autoPromptBiometrics: false,
|
||||
// Account Preferences
|
||||
clearClipboard: [null],
|
||||
@@ -351,9 +351,9 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||
),
|
||||
pin: this.userHasPinSet,
|
||||
biometric: await this.vaultTimeoutSettingsService.isBiometricLockSet(),
|
||||
allowBiometricUnlockOnAppRestart: await this.biometricsService.hasPersistentKey(
|
||||
requireMasterPasswordOnAppRestart: !(await this.biometricsService.hasPersistentKey(
|
||||
activeAccount.id,
|
||||
),
|
||||
)),
|
||||
autoPromptBiometrics: await firstValueFrom(this.biometricStateService.promptAutomatically$),
|
||||
clearClipboard: await firstValueFrom(this.autofillSettingsService.clearClipboardDelay$),
|
||||
minimizeOnCopyToClipboard: await firstValueFrom(this.desktopSettingsService.minimizeOnCopy$),
|
||||
@@ -446,15 +446,17 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe();
|
||||
this.form.controls.allowBiometricUnlockOnAppRestart.valueChanges
|
||||
this.form.controls.requireMasterPasswordOnAppRestart.valueChanges
|
||||
.pipe(
|
||||
concatMap(async (enabled) => {
|
||||
concatMap(async (requireMasterPassword) => {
|
||||
const userKey = await firstValueFrom(this.keyService.userKey$(activeAccount.id));
|
||||
if (enabled) {
|
||||
if (!requireMasterPassword) {
|
||||
// Allow biometric unlock on app restart
|
||||
if (!(await this.biometricsService.hasPersistentKey(activeAccount.id))) {
|
||||
await this.biometricsService.enrollPersistent(activeAccount.id, userKey);
|
||||
}
|
||||
} else {
|
||||
// Require master password on app restart
|
||||
await this.biometricsService.deleteBiometricUnlockKeyForUser(activeAccount.id);
|
||||
await this.biometricsService.setBiometricProtectedUnlockKeyForUser(
|
||||
activeAccount.id,
|
||||
|
||||
@@ -1846,8 +1846,8 @@
|
||||
"lockWithMasterPassOnRestart1": {
|
||||
"message": "Lock with master password on restart"
|
||||
},
|
||||
"allowBiometricUnlockOnAppRestart": {
|
||||
"message": "Allow biometric unlock for the first unlock after restarting the app"
|
||||
"requireMasterPasswordOnAppRestart": {
|
||||
"message": "Require master password or PIN on app restart"
|
||||
},
|
||||
"deleteAccount": {
|
||||
"message": "Delete account"
|
||||
|
||||
Reference in New Issue
Block a user