Rename customPrompt to authenticationPrompt
This commit is contained in:
parent
7efae775e1
commit
9c734ac9f9
|
@ -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),
|
||||
|
|
2
index.js
2
index.js
|
@ -58,7 +58,7 @@ type LAPolicy = 'Authentication' | 'AuthenticationWithBiometrics';
|
|||
|
||||
type SecureOptions = {
|
||||
service?: string,
|
||||
customPrompt?: string,
|
||||
authenticationPrompt?: string,
|
||||
authenticationType?: LAPolicy,
|
||||
accessControl?: SecAccessControl,
|
||||
};
|
||||
|
|
|
@ -12,8 +12,8 @@ declare module 'react-native-keychain' {
|
|||
}
|
||||
|
||||
export interface SecureOptions {
|
||||
service: string;
|
||||
customPrompt?: string;
|
||||
service?: string;
|
||||
authenticationPrompt?: string;
|
||||
authenticationType?: string;
|
||||
accessControl?: string;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue