1
0
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:
Bernd Schoolmann
2025-01-14 18:29:52 +01:00
committed by GitHub
parent 63a9c69f5a
commit 318a3ac6a9
4 changed files with 22 additions and 6 deletions

View File

@@ -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();
}