diff --git a/.changeset/olive-terms-check.md b/.changeset/olive-terms-check.md new file mode 100644 index 00000000..1814cdf0 --- /dev/null +++ b/.changeset/olive-terms-check.md @@ -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`. diff --git a/packages/react-native-app-auth/ios/RNAppAuth.m b/packages/react-native-app-auth/ios/RNAppAuth.m index eb11aa55..938c045c 100644 --- a/packages/react-native-app-auth/ios/RNAppAuth.m +++ b/packages/react-native-app-auth/ios/RNAppAuth.m @@ -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) { @@ -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) { @@ -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 { @@ -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 { @@ -734,7 +734,7 @@ - (NSString*)getErrorMessage: (NSError*) error { } - (id)getExternalUserAgentWithPresentingViewController: (UIViewController *)presentingViewController - prefersEphemeralSession: (BOOL *) prefersEphemeralSession + prefersEphemeralSession: (BOOL) prefersEphemeralSession { id externalUserAgent; #if TARGET_OS_MACCATALYST