Skip to content

fix(ios): marshal booleans correctly (#999, #980) #1000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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