Open Ritik5Prasad opened 2 months ago
export const loginWithBiometrics = async (userID: string) => { try { const isBiometricAvailable = await checkBiometrics(); if (!isBiometricAvailable) { throw new Error("Biometric not available"); } const { keysExist } = await rnBiometrics.biometricKeysExist();
if (!keysExist) { const { publicKey } = await rnBiometrics.createKeys(); console.log("PUblicKey ", publicKey); } const { success, signature } = await rnBiometrics.createSignature({ promptMessage: "Sign in", payload: userID, }); if (!success) { throw new Error("Biometrics authentication failed!"); } console.log(signature); if (signature) { return true; } else { return false; }
} catch (error) { console.log("Error@@", JSON.stringify(error)); return false; } };
Error@@ {"nativeStackAndroid":[],"userInfo":null,"message":"Error creating signature","code":"Error creating signature: android.security.KeyStoreException: Key user not authenticated (internal Keystore code: -26 message: In KeystoreOperation::finish\n\nCaused by:\n 0: In finish: KeyMint::finish failed.\n 1: Error::Km(ErrorCode(-26))) (public error code: 2 internal Keystore code: -26)"}
+1
export const loginWithBiometrics = async (userID: string) => { try { const isBiometricAvailable = await checkBiometrics(); if (!isBiometricAvailable) { throw new Error("Biometric not available"); } const { keysExist } = await rnBiometrics.biometricKeysExist();
} catch (error) { console.log("Error@@", JSON.stringify(error)); return false; } };
Error@@ {"nativeStackAndroid":[],"userInfo":null,"message":"Error creating signature","code":"Error creating signature: android.security.KeyStoreException: Key user not authenticated (internal Keystore code: -26 message: In KeystoreOperation::finish\n\nCaused by:\n 0: In finish: KeyMint::finish failed.\n 1: Error::Km(ErrorCode(-26))) (public error code: 2 internal Keystore code: -26)"}