Skip to content

fix(auth, ios): fixes inappropriate linking when host is nil #8517

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 1 commit into from
May 13, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ static void InitializeFlipper(UIApplication *application) {

// Linking API
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// @generated begin @react-native-firebase/auth-openURL - expo prebuild (DO NOT MODIFY) sync-5e029a87ac71df3ca5665387eb712d1b32274c6a
if ([url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
// @generated begin @react-native-firebase/auth-openURL - expo prebuild (DO NOT MODIFY) sync-11c57ab508c3e776ab45ad4f3c3cb28310f617ea
if (url.host && [url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
// invocations for Firebase Auth are handled elsewhere and should not be forwarded to Expo Router
return NO;
}
Expand Down Expand Up @@ -165,8 +165,8 @@ static void InitializeFlipper(UIApplication *application) {

// Linking API
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// @generated begin @react-native-firebase/auth-openURL - expo prebuild (DO NOT MODIFY) sync-5e029a87ac71df3ca5665387eb712d1b32274c6a
if ([url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
// @generated begin @react-native-firebase/auth-openURL - expo prebuild (DO NOT MODIFY) sync-11c57ab508c3e776ab45ad4f3c3cb28310f617ea
if (url.host && [url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
// invocations for Firebase Auth are handled elsewhere and should not be forwarded to Expo Router
return NO;
}
Expand Down Expand Up @@ -266,8 +266,8 @@ exports[`Config Plugin iOS Tests - openUrlFix munges AppDelegate correctly - App

// Linking API
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// @generated begin @react-native-firebase/auth-openURL - expo prebuild (DO NOT MODIFY) sync-5e029a87ac71df3ca5665387eb712d1b32274c6a
if ([url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
// @generated begin @react-native-firebase/auth-openURL - expo prebuild (DO NOT MODIFY) sync-11c57ab508c3e776ab45ad4f3c3cb28310f617ea
if (url.host && [url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
// invocations for Firebase Auth are handled elsewhere and should not be forwarded to Expo Router
return NO;
}
Expand Down Expand Up @@ -378,8 +378,8 @@ public class AppDelegate: ExpoAppDelegate {

exports[`Config Plugin iOS Tests - openUrlFix must match positiveTemplateCases[0] 1`] = `
"- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// @generated begin @react-native-firebase/auth-openURL - expo prebuild (DO NOT MODIFY) sync-5e029a87ac71df3ca5665387eb712d1b32274c6a
if ([url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
// @generated begin @react-native-firebase/auth-openURL - expo prebuild (DO NOT MODIFY) sync-11c57ab508c3e776ab45ad4f3c3cb28310f617ea
if (url.host && [url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
// invocations for Firebase Auth are handled elsewhere and should not be forwarded to Expo Router
return NO;
}
Expand All @@ -392,8 +392,8 @@ exports[`Config Plugin iOS Tests - openUrlFix must match positiveTemplateCases[3

{

// @generated begin @react-native-firebase/auth-openURL - expo prebuild (DO NOT MODIFY) sync-5e029a87ac71df3ca5665387eb712d1b32274c6a
if ([url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
// @generated begin @react-native-firebase/auth-openURL - expo prebuild (DO NOT MODIFY) sync-11c57ab508c3e776ab45ad4f3c3cb28310f617ea
if (url.host && [url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
// invocations for Firebase Auth are handled elsewhere and should not be forwarded to Expo Router
return NO;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/plugin/src/ios/openUrlFix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function modifyAppDelegate(contents: string, language: string): string |
}

const skipOpenUrlForFirebaseAuthBlock: string = `\
if ([url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
if (url.host && [url.host caseInsensitiveCompare:@"firebaseauth"] == NSOrderedSame) {
// invocations for Firebase Auth are handled elsewhere and should not be forwarded to Expo Router
return NO;
}\
Expand Down
Loading