Skip to content

Commit ee7a295

Browse files
committed
fix: Handle NSNull in iosCustomBrowser param for logout
1 parent ad3018d commit ee7a295

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,13 @@ - (void)endSessionWithConfiguration: (OIDServiceConfiguration *) configuration
517517
#if TARGET_OS_MACCATALYST
518518
id<OIDExternalUserAgent> externalUserAgent = nil;
519519
#elif TARGET_OS_IOS
520-
id<OIDExternalUserAgent> externalUserAgent = iosCustomBrowser != nil ? [self getCustomBrowser: iosCustomBrowser] : [self getExternalUserAgentWithPresentingViewController:presentingViewController
521-
prefersEphemeralSession:prefersEphemeralSession];
520+
id<OIDExternalUserAgent> externalUserAgent;
521+
if (iosCustomBrowser != nil && ![iosCustomBrowser isEqual:[NSNull null]]) {
522+
externalUserAgent = [self getCustomBrowser:iosCustomBrowser];
523+
} else {
524+
externalUserAgent = [self getExternalUserAgentWithPresentingViewController:presentingViewController
525+
prefersEphemeralSession:prefersEphemeralSession];
526+
}
522527
#endif
523528

524529
_currentSession = [OIDAuthorizationService presentEndSessionRequest: endSessionRequest

0 commit comments

Comments
 (0)