react-native-credentials-manager 0.8.0 → 0.8.2

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.
@@ -6,6 +6,7 @@ import androidx.credentials.exceptions.GetCredentialException
6
6
  import androidx.credentials.exceptions.NoCredentialException
7
7
  import com.credentialsmanager.handlers.CredentialHandler
8
8
  import com.credentialsmanager.handlers.ErrorHandler
9
+ import com.facebook.react.bridge.Arguments
9
10
  import com.facebook.react.bridge.Promise
10
11
  import com.facebook.react.bridge.ReactApplicationContext
11
12
  import com.facebook.react.bridge.ReadableArray
@@ -68,11 +69,11 @@ class CredentialsManagerModule(
68
69
  credentialHandler.createPassword(username, password)
69
70
 
70
71
  // Create success response
71
- val result = mapOf(
72
- "type" to "password",
73
- "username" to username,
74
- "success" to true
75
- )
72
+ val result = Arguments.createMap().apply {
73
+ putString("type", "password")
74
+ putString("username", username)
75
+ putBoolean("success", true)
76
+ }
76
77
  promise.resolve(result)
77
78
  } catch (e: CreateCredentialException) {
78
79
  ErrorHandler.handleCredentialError(e)
@@ -6,6 +6,7 @@ import androidx.credentials.exceptions.GetCredentialException
6
6
  import androidx.credentials.exceptions.NoCredentialException
7
7
  import com.credentialsmanager.handlers.CredentialHandler
8
8
  import com.credentialsmanager.handlers.ErrorHandler
9
+ import com.facebook.react.bridge.Arguments
9
10
  import com.facebook.react.bridge.Promise
10
11
  import com.facebook.react.bridge.ReactApplicationContext
11
12
  import com.facebook.react.bridge.ReactContextBaseJavaModule
@@ -74,11 +75,11 @@ class CredentialsManagerModule(
74
75
  credentialHandler.createPassword(username, password)
75
76
 
76
77
  // Create success response
77
- val result = mapOf(
78
- "type" to "password",
79
- "username" to username,
80
- "success" to true
81
- )
78
+ val result = Arguments.createMap().apply {
79
+ putString("type", "password")
80
+ putString("username", username)
81
+ putBoolean("success", true)
82
+ }
82
83
  promise.resolve(result)
83
84
  } catch (e: CreateCredentialException) {
84
85
  ErrorHandler.handleCredentialError(e)
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} = configPlugin
4
+ const { createRunOncePlugin, withEntitlementsPlist, withInfoPlist } =
5
+ configPlugin;
5
6
 
6
7
  const withAllowMixedLocalizations = function (config) {
7
- return withInfoPlist(config, function (config) {
8
- config.modResults.CFBundleAllowMixedLocalizations =
9
- config.modResults.CFBundleAllowMixedLocalizations ?? true;
8
+ return withInfoPlist(config, function (modConfig) {
9
+ modConfig.modResults.CFBundleAllowMixedLocalizations =
10
+ modConfig.modResults.CFBundleAllowMixedLocalizations ?? true;
10
11
 
11
- return config;
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 (config) {
18
- config.modResults['com.apple.developer.applesignin'] = ['Default'];
19
- return config;
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.0",
3
+ "version": "0.8.2",
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",
@@ -126,10 +126,13 @@
126
126
  "release-it": {
127
127
  "git": {
128
128
  "commitMessage": "chore: release ${version}",
129
- "tagName": "v${version}"
129
+ "tagName": "v${version}",
130
+ "requireCommits": true,
131
+ "requireCommitsFail": false
130
132
  },
131
133
  "npm": {
132
- "publish": true
134
+ "publish": true,
135
+ "skipChecks": true
133
136
  },
134
137
  "github": {
135
138
  "release": true