Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
checkAuthenticationsTypes = async () => {
const result = await LocalAuthentication.supportedAuthenticationTypesAsync();
const stringResult = result
.map(type => {
switch (type) {
case LocalAuthentication.AuthenticationType.FINGERPRINT:
return 'FINGERPRINT';
case LocalAuthentication.AuthenticationType.FACIAL_RECOGNITION:
return 'FACIAL_RECOGNITION';
default:
throw new Error(`Unrecognised authentication type returned: '${type}'`);
}
})
.join(', ');
alert(stringResult ? `Available types: ${stringResult}` : 'No available authentication types!');
};