Fix isSupported method of biometric keystore on cordova

This commit is contained in:
Martin Kleinschrodt 2021-08-31 14:56:42 +02:00
parent 39f388bc54
commit c92bb61bba
1 changed files with 9 additions and 3 deletions

View File

@ -70,7 +70,13 @@ export class CordovaPlatform extends WebPlatform implements Platform {
biometricKeyStore = {
async isSupported() {
return Fingerprint.isAvailable();
await cordovaReady;
return new Promise<boolean>((resolve) =>
Fingerprint.isAvailable(
(res: string) => resolve(!!res),
() => resolve(false)
)
);
},
async storeKey(_id: string, key: Uint8Array) {
@ -126,7 +132,7 @@ export class CordovaPlatform extends WebPlatform implements Platform {
readonly platformMFAType = MFAType.PublicKey;
async supportsPlatformAuthenticator() {
return await this.biometricKeyStore.isSupported();
supportsPlatformAuthenticator() {
return this.biometricKeyStore.isSupported();
}
}