1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

Get either 'Bitwarden' and 'Bitwarden_biometric' keys. (#1904)

* Get either 'Bitwarden' and 'Bitwarden_biometric' keys.

* Fix let var typo

* Fix string handling error

* Retrieve biometric key from Desktop

* Null check key
This commit is contained in:
Matt Gibson
2021-06-22 16:11:29 -04:00
committed by GitHub
parent 20df6fe230
commit f35f3550a7
3 changed files with 22 additions and 4 deletions

View File

@@ -0,0 +1,14 @@
import { KeySuffixOptions } from 'jslib-common/abstractions/storage.service';
import { CryptoService } from 'jslib-common/services/crypto.service';
export class BrowserCryptoService extends CryptoService {
protected async retrieveKeyFromStorage(keySuffix: KeySuffixOptions) {
if (keySuffix === 'biometric') {
await this.platformUtilService.authenticateBiometric();
return (await this.getKey())?.keyB64;
}
return await super.retrieveKeyFromStorage(keySuffix);
}
}