Skip to content

Commit

Permalink
fix(ios): marshal booleans correctly (#999, #980) (#1000)
Browse files Browse the repository at this point in the history
  • Loading branch information
shirakaba authored Jul 24, 2024
1 parent fe3646e commit 31f903f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/olive-terms-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-native-app-auth': major
---

Breaking change (iOS, Mac Catalyst): The boolean values `useNonce`, `usePCKE`, and `prefersEphemeralSession` are now handled correctly. Previously, they were all being interpreted as `false` regardless of their actual values, but now the intended (`true` or `false`) value is correctly marshalled from JavaScript to native. To preserve behaviour from before this breaking change, explicitly set them all to `false`.
18 changes: 9 additions & 9 deletions packages/react-native-app-auth/ios/RNAppAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ - (dispatch_queue_t)methodQueue
skipCodeExchange: (BOOL) skipCodeExchange
connectionTimeoutSeconds: (double) connectionTimeoutSeconds
additionalHeaders: (NSDictionary *_Nullable) additionalHeaders
useNonce: (BOOL *) useNonce
usePKCE: (BOOL *) usePKCE
useNonce: (BOOL) useNonce
usePKCE: (BOOL) usePKCE
iosCustomBrowser: (NSString *) iosCustomBrowser
prefersEphemeralSession: (BOOL *) prefersEphemeralSession
prefersEphemeralSession: (BOOL) prefersEphemeralSession
resolve: (RCTPromiseResolveBlock) resolve
reject: (RCTPromiseRejectBlock) reject)
{
Expand Down Expand Up @@ -204,7 +204,7 @@ - (dispatch_queue_t)methodQueue
serviceConfiguration: (NSDictionary *_Nullable) serviceConfiguration
additionalParameters: (NSDictionary *_Nullable) additionalParameters
iosCustomBrowser: (NSString *) iosCustomBrowser
prefersEphemeralSession: (BOOL *) prefersEphemeralSession
prefersEphemeralSession: (BOOL) prefersEphemeralSession
resolve:(RCTPromiseResolveBlock) resolve
reject: (RCTPromiseRejectBlock) reject)
{
Expand Down Expand Up @@ -325,12 +325,12 @@ - (void)authorizeWithConfiguration: (OIDServiceConfiguration *) configuration
clientId: (NSString *) clientId
clientSecret: (NSString *) clientSecret
scopes: (NSArray *) scopes
useNonce: (BOOL *) useNonce
usePKCE: (BOOL *) usePKCE
useNonce: (BOOL) useNonce
usePKCE: (BOOL) usePKCE
additionalParameters: (NSDictionary *_Nullable) additionalParameters
skipCodeExchange: (BOOL) skipCodeExchange
iosCustomBrowser: (NSString *) iosCustomBrowser
prefersEphemeralSession: (BOOL *) prefersEphemeralSession
prefersEphemeralSession: (BOOL) prefersEphemeralSession
resolve: (RCTPromiseResolveBlock) resolve
reject: (RCTPromiseRejectBlock) reject
{
Expand Down Expand Up @@ -489,7 +489,7 @@ - (void)endSessionWithConfiguration: (OIDServiceConfiguration *) configuration
postLogoutRedirectURL: (NSString *) postLogoutRedirectURL
additionalParameters: (NSDictionary *_Nullable) additionalParameters
iosCustomBrowser: (NSString *) iosCustomBrowser
prefersEphemeralSession: (BOOL *) prefersEphemeralSession
prefersEphemeralSession: (BOOL) prefersEphemeralSession
resolve: (RCTPromiseResolveBlock) resolve
reject: (RCTPromiseRejectBlock) reject {

Expand Down Expand Up @@ -734,7 +734,7 @@ - (NSString*)getErrorMessage: (NSError*) error {
}

- (id<OIDExternalUserAgent>)getExternalUserAgentWithPresentingViewController: (UIViewController *)presentingViewController
prefersEphemeralSession: (BOOL *) prefersEphemeralSession
prefersEphemeralSession: (BOOL) prefersEphemeralSession
{
id<OIDExternalUserAgent> externalUserAgent;
#if TARGET_OS_MACCATALYST
Expand Down

0 comments on commit 31f903f

Please sign in to comment.