Skip to content

Commit 31f903f

Browse files
authored
fix(ios): marshal booleans correctly (#999, #980) (#1000)
1 parent fe3646e commit 31f903f

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.changeset/olive-terms-check.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-app-auth': major
3+
---
4+
5+
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`.

packages/react-native-app-auth/ios/RNAppAuth.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ - (dispatch_queue_t)methodQueue
9797
skipCodeExchange: (BOOL) skipCodeExchange
9898
connectionTimeoutSeconds: (double) connectionTimeoutSeconds
9999
additionalHeaders: (NSDictionary *_Nullable) additionalHeaders
100-
useNonce: (BOOL *) useNonce
101-
usePKCE: (BOOL *) usePKCE
100+
useNonce: (BOOL) useNonce
101+
usePKCE: (BOOL) usePKCE
102102
iosCustomBrowser: (NSString *) iosCustomBrowser
103-
prefersEphemeralSession: (BOOL *) prefersEphemeralSession
103+
prefersEphemeralSession: (BOOL) prefersEphemeralSession
104104
resolve: (RCTPromiseResolveBlock) resolve
105105
reject: (RCTPromiseRejectBlock) reject)
106106
{
@@ -204,7 +204,7 @@ - (dispatch_queue_t)methodQueue
204204
serviceConfiguration: (NSDictionary *_Nullable) serviceConfiguration
205205
additionalParameters: (NSDictionary *_Nullable) additionalParameters
206206
iosCustomBrowser: (NSString *) iosCustomBrowser
207-
prefersEphemeralSession: (BOOL *) prefersEphemeralSession
207+
prefersEphemeralSession: (BOOL) prefersEphemeralSession
208208
resolve:(RCTPromiseResolveBlock) resolve
209209
reject: (RCTPromiseRejectBlock) reject)
210210
{
@@ -325,12 +325,12 @@ - (void)authorizeWithConfiguration: (OIDServiceConfiguration *) configuration
325325
clientId: (NSString *) clientId
326326
clientSecret: (NSString *) clientSecret
327327
scopes: (NSArray *) scopes
328-
useNonce: (BOOL *) useNonce
329-
usePKCE: (BOOL *) usePKCE
328+
useNonce: (BOOL) useNonce
329+
usePKCE: (BOOL) usePKCE
330330
additionalParameters: (NSDictionary *_Nullable) additionalParameters
331331
skipCodeExchange: (BOOL) skipCodeExchange
332332
iosCustomBrowser: (NSString *) iosCustomBrowser
333-
prefersEphemeralSession: (BOOL *) prefersEphemeralSession
333+
prefersEphemeralSession: (BOOL) prefersEphemeralSession
334334
resolve: (RCTPromiseResolveBlock) resolve
335335
reject: (RCTPromiseRejectBlock) reject
336336
{
@@ -489,7 +489,7 @@ - (void)endSessionWithConfiguration: (OIDServiceConfiguration *) configuration
489489
postLogoutRedirectURL: (NSString *) postLogoutRedirectURL
490490
additionalParameters: (NSDictionary *_Nullable) additionalParameters
491491
iosCustomBrowser: (NSString *) iosCustomBrowser
492-
prefersEphemeralSession: (BOOL *) prefersEphemeralSession
492+
prefersEphemeralSession: (BOOL) prefersEphemeralSession
493493
resolve: (RCTPromiseResolveBlock) resolve
494494
reject: (RCTPromiseRejectBlock) reject {
495495

@@ -734,7 +734,7 @@ - (NSString*)getErrorMessage: (NSError*) error {
734734
}
735735

736736
- (id<OIDExternalUserAgent>)getExternalUserAgentWithPresentingViewController: (UIViewController *)presentingViewController
737-
prefersEphemeralSession: (BOOL *) prefersEphemeralSession
737+
prefersEphemeralSession: (BOOL) prefersEphemeralSession
738738
{
739739
id<OIDExternalUserAgent> externalUserAgent;
740740
#if TARGET_OS_MACCATALYST

0 commit comments

Comments
 (0)