mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 03:33:54 +00:00
[PM-17038] Fix biometrics autoprompt in firefox and chrome (#12853)
* Fix biometrics not working in firefox or windows * Remove logs * Update badge after biometric unlock * Add removal todo note * Remove debug logging * Fix type warnings * Fix userkey typing in background biometrics service * Simplify types for userkey in foreground-browser-biometrics and runtime.background.ts * Add process reload logging * Fix autoprompt not working when no process reload happened * Fix instant reprompt on firefox lock * Fix biometrics enabling error on chrome * Update apps/browser/src/key-management/biometrics/foreground-browser-biometrics.ts Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com> * FIx build & linting --------- Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com>
This commit is contained in:
@@ -307,10 +307,12 @@ export class LockComponent implements OnInit, OnDestroy {
|
||||
(await this.biometricService.getShouldAutopromptNow())
|
||||
) {
|
||||
await this.biometricService.setShouldAutopromptNow(false);
|
||||
|
||||
const lastProcessReload = await this.biometricStateService.getLastProcessReload();
|
||||
if (
|
||||
(await this.biometricStateService.getLastProcessReload()) == null ||
|
||||
Date.now() - (await this.biometricStateService.getLastProcessReload()).getTime() >
|
||||
AUTOPROMPT_BIOMETRICS_PROCESS_RELOAD_DELAY
|
||||
lastProcessReload == null ||
|
||||
isNaN(lastProcessReload.getTime()) ||
|
||||
Date.now() - lastProcessReload.getTime() > AUTOPROMPT_BIOMETRICS_PROCESS_RELOAD_DELAY
|
||||
) {
|
||||
await this.unlockViaBiometrics();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user