Skip to content

Commit 70c7255

Browse files
committed
authenticate user with facial recg and fingerprint
1 parent 27f7457 commit 70c7255

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

App.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,23 @@ export default function App() {
8484
// fallbackLabel ?: string;
8585

8686
// Authenticate use with Biometrics (Fingerprint, Facial recognition, Iris recognition)
87-
const biometricPrompt = await LocalAuthentication.authenticateAsync(
88-
'Touch the screen to'
89-
);
87+
let promptMessage;
88+
supportedBiometrics === 1
89+
? (promptMessage = 'Please touch sensor when ready')
90+
: 'Use face recognition';
91+
92+
const biometricAuth = await LocalAuthentication.authenticateAsync({
93+
promptMessage: 'Login with Biometrics',
94+
cancelLabel: 'Cancel',
95+
disableDeviceFallback: true,
96+
});
97+
// Log the user in on success
98+
if (biometricAuth) console.log('success');
9099

91100
console.log({ isBiometricAvailable });
92101
console.log({ supportedBiometrics });
93102
console.log({ savedBiometrics });
94-
console.log({ biometricPrompt });
103+
console.log({ biometricAuth });
95104
};
96105

97106
return (

0 commit comments

Comments
 (0)