1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

Move fingerprint validated to biometric state povider (#8058)

This commit is contained in:
Matt Gibson
2024-03-07 19:41:56 -06:00
committed by GitHub
parent eedd6f0881
commit f83dcf2b24
9 changed files with 74 additions and 15 deletions

View File

@@ -814,6 +814,7 @@ export default class MainBackground {
this.stateService,
this.autofillSettingsService,
this.vaultTimeoutSettingsService,
this.biometricStateService,
);
// Other fields

View File

@@ -84,10 +84,6 @@ export class NativeMessagingBackground {
private authService: AuthService,
private biometricStateService: BiometricStateService,
) {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.stateService.setBiometricFingerprintValidated(false);
if (chrome?.permissions?.onAdded) {
// Reload extension to activate nativeMessaging
chrome.permissions.onAdded.addListener((permissions) => {
@@ -100,9 +96,7 @@ export class NativeMessagingBackground {
async connect() {
this.appId = await this.appIdService.getAppId();
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.stateService.setBiometricFingerprintValidated(false);
await this.biometricStateService.setFingerprintValidated(false);
return new Promise<void>((resolve, reject) => {
this.port = BrowserApi.connectNative("com.8bit.bitwarden");
@@ -148,9 +142,7 @@ export class NativeMessagingBackground {
if (this.validatingFingerprint) {
this.validatingFingerprint = false;
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.stateService.setBiometricFingerprintValidated(true);
await this.biometricStateService.setFingerprintValidated(true);
}
this.sharedSecret = new SymmetricCryptoKey(decrypted);
this.secureSetupResolve();

View File

@@ -415,7 +415,7 @@ export class SettingsComponent implements OnInit {
]);
} else {
await this.biometricStateService.setBiometricUnlockEnabled(false);
await this.stateService.setBiometricFingerprintValidated(false);
await this.biometricStateService.setFingerprintValidated(false);
}
}

View File

@@ -126,6 +126,7 @@ const RELOAD_CALLBACK = new InjectionToken<() => any>("RELOAD_CALLBACK");
StateServiceAbstraction,
AutofillSettingsServiceAbstraction,
VaultTimeoutSettingsService,
BiometricStateService,
],
},
{