Rename customPrompt to authenticationPrompt

This commit is contained in:
Joel Arvidsson 2018-02-25 23:42:15 +01:00
parent 7efae775e1
commit 9c734ac9f9
3 changed files with 8 additions and 8 deletions

View File

@ -111,7 +111,7 @@ NSString *serviceValue(NSDictionary *options)
#pragma mark - Proposed functionality - Helpers
#define kAuthenticationType @"authenticationType"
#define kBiometrics @"AuthenticationWithBiometrics"
#define kAuthenticationTypeBiometrics @"AuthenticationWithBiometrics"
#define kAccessControlType @"accessControl"
#define kAccessControlUserPresence @"UserPresence"
@ -124,12 +124,12 @@ NSString *serviceValue(NSDictionary *options)
#define kBiometryTypeTouchID @"TouchID"
#define kBiometryTypeFaceID @"FaceID"
#define kCustomPromptMessage @"customPrompt"
#define kAuthenticationPromptMessage @"authenticationPrompt"
LAPolicy authPolicy(NSDictionary *options)
{
if (options && options[kAuthenticationType]) {
if ([ options[kAuthenticationType] isEqualToString:kBiometrics ]) {
if ([ options[kAuthenticationType] isEqualToString:kAuthenticationTypeBiometrics ]) {
return LAPolicyDeviceOwnerAuthenticationWithBiometrics;
}
}
@ -264,8 +264,8 @@ RCT_EXPORT_METHOD(getPasswordWithAuthentication:(NSDictionary *)options resolver
{
NSString *service = serviceValue(options);
NSString *promptMessage = @"Authenticate to retrieve secret!";
if (options && options[kCustomPromptMessage]) {
promptMessage = options[kCustomPromptMessage];
if (options && options[kAuthenticationPromptMessage]) {
promptMessage = options[kAuthenticationPromptMessage];
}
NSMutableDictionary *dict = @{ (__bridge NSString *)kSecClass : (__bridge id)(kSecClassGenericPassword),

View File

@ -58,7 +58,7 @@ type LAPolicy = 'Authentication' | 'AuthenticationWithBiometrics';
type SecureOptions = {
service?: string,
customPrompt?: string,
authenticationPrompt?: string,
authenticationType?: LAPolicy,
accessControl?: SecAccessControl,
};

View File

@ -12,8 +12,8 @@ declare module 'react-native-keychain' {
}
export interface SecureOptions {
service: string;
customPrompt?: string;
service?: string;
authenticationPrompt?: string;
authenticationType?: string;
accessControl?: string;
}