react-native-credentials-manager 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app.plugin.js +9 -8
- package/ios/CredentialsManager.mm +2 -7
- package/package.json +1 -1
package/app.plugin.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
// set Info.plist values
|
|
2
2
|
import configPlugin from '@expo/config-plugins';
|
|
3
3
|
|
|
4
|
-
const {createRunOncePlugin, withEntitlementsPlist, withInfoPlist} =
|
|
4
|
+
const { createRunOncePlugin, withEntitlementsPlist, withInfoPlist } =
|
|
5
|
+
configPlugin;
|
|
5
6
|
|
|
6
7
|
const withAllowMixedLocalizations = function (config) {
|
|
7
|
-
return withInfoPlist(config, function (
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
return withInfoPlist(config, function (modConfig) {
|
|
9
|
+
modConfig.modResults.CFBundleAllowMixedLocalizations =
|
|
10
|
+
modConfig.modResults.CFBundleAllowMixedLocalizations ?? true;
|
|
10
11
|
|
|
11
|
-
return
|
|
12
|
+
return modConfig;
|
|
12
13
|
});
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
const withDefaultAppleSignIn = function (config) {
|
|
16
17
|
config = withAllowMixedLocalizations(config);
|
|
17
|
-
return withEntitlementsPlist(config, function (
|
|
18
|
-
|
|
19
|
-
return
|
|
18
|
+
return withEntitlementsPlist(config, function (modConfig) {
|
|
19
|
+
modConfig.modResults['com.apple.developer.applesignin'] = ['Default'];
|
|
20
|
+
return modConfig;
|
|
20
21
|
});
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -118,6 +118,8 @@ preferImmediatelyAvailableCredentials:(BOOL)preferImmediatelyAvailableCredential
|
|
|
118
118
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
119
119
|
reject:(RCTPromiseRejectBlock)reject {
|
|
120
120
|
|
|
121
|
+
id passkeyParams = params.passkeys();
|
|
122
|
+
|
|
121
123
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
122
124
|
self.currentResolve = resolve;
|
|
123
125
|
self.currentReject = reject;
|
|
@@ -126,8 +128,6 @@ preferImmediatelyAvailableCredentials:(BOOL)preferImmediatelyAvailableCredential
|
|
|
126
128
|
|
|
127
129
|
for (NSString *option in options) {
|
|
128
130
|
if ([option isEqualToString:@"passkeys"]) {
|
|
129
|
-
// Extract passkeys parameters from the params object
|
|
130
|
-
id passkeyParams = params.passkeys();
|
|
131
131
|
if (!passkeyParams || ![passkeyParams isKindOfClass:[NSDictionary class]]) {
|
|
132
132
|
RCTLogError(@"Missing or invalid passkeys parameters");
|
|
133
133
|
continue;
|
|
@@ -167,11 +167,9 @@ preferImmediatelyAvailableCredentials:(BOOL)preferImmediatelyAvailableCredential
|
|
|
167
167
|
ASAuthorizationPasswordRequest *passwordRequest = [passwordProvider createRequest];
|
|
168
168
|
[authRequests addObject:passwordRequest];
|
|
169
169
|
} else if ([option isEqualToString:@"apple-signin"]) {
|
|
170
|
-
// Apple Sign In is supported by Authentication Services
|
|
171
170
|
ASAuthorizationAppleIDProvider *appleIDProvider = [[ASAuthorizationAppleIDProvider alloc] init];
|
|
172
171
|
ASAuthorizationAppleIDRequest *appleIDRequest = [appleIDProvider createRequest];
|
|
173
172
|
|
|
174
|
-
// Default scopes - always use these
|
|
175
173
|
NSArray<ASAuthorizationScope> *defaultScopes = @[ASAuthorizationScopeFullName, ASAuthorizationScopeEmail];
|
|
176
174
|
appleIDRequest.requestedScopes = defaultScopes;
|
|
177
175
|
|
|
@@ -202,7 +200,6 @@ preferImmediatelyAvailableCredentials:(BOOL)preferImmediatelyAvailableCredential
|
|
|
202
200
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
203
201
|
reject:(RCTPromiseRejectBlock)reject {
|
|
204
202
|
// Google Sign In is not part of Apple's Authentication Services framework
|
|
205
|
-
// This should be handled at the JavaScript layer for cross-platform compatibility
|
|
206
203
|
reject(@"UNSUPPORTED_OPERATION", @"Google Sign In is not available on iOS. Use Apple Sign In instead.", nil);
|
|
207
204
|
}
|
|
208
205
|
|
|
@@ -214,11 +211,9 @@ preferImmediatelyAvailableCredentials:(BOOL)preferImmediatelyAvailableCredential
|
|
|
214
211
|
self.currentResolve = resolve;
|
|
215
212
|
self.currentReject = reject;
|
|
216
213
|
|
|
217
|
-
// Apple Sign In is officially supported by Authentication Services framework
|
|
218
214
|
ASAuthorizationAppleIDProvider *appleIDProvider = [[ASAuthorizationAppleIDProvider alloc] init];
|
|
219
215
|
ASAuthorizationAppleIDRequest *appleIDRequest = [appleIDProvider createRequest];
|
|
220
216
|
|
|
221
|
-
// Always use the default scopes
|
|
222
217
|
appleIDRequest.requestedScopes = @[ASAuthorizationScopeFullName, ASAuthorizationScopeEmail];
|
|
223
218
|
|
|
224
219
|
ASAuthorizationController *authController = [[ASAuthorizationController alloc] initWithAuthorizationRequests:@[appleIDRequest]];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-credentials-manager",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "A React Native library that implements the Credential Manager API for Android. This library allows you to manage passwords and passkeys in your React Native applications.",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|