Skip to content
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

fix(auth): use correct app instance (vs always default) in multifactor and phone auth #7564

Merged
merged 7 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
},
"sdkVersions": {
"ios": {
"firebase": "10.19.0",
"firebase": "10.20.0",
"iosTarget": "11.0",
"macosTarget": "10.13"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void onCatalystInstanceDestroy() {
mMultiFactorSessions.clear();
}

@ReactMethod
@ReactMethod
public void configureAuthDomain(final String appName) {
Log.d(TAG, "configureAuthDomain");
FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
Expand Down Expand Up @@ -1140,10 +1140,11 @@ public void verifyPhoneNumberWithMultiFactorInfo(
promise, "unknown", "Unsupported second factor. Only phone factors are supported.");
return;
}

FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(firebaseApp);
final Activity activity = getCurrentActivity();
final PhoneAuthOptions phoneAuthOptions =
PhoneAuthOptions.newBuilder()
PhoneAuthOptions.newBuilder(firebaseAuth)
.setActivity(activity)
.setMultiFactorHint((PhoneMultiFactorInfo) selectedHint)
.setTimeout(30L, TimeUnit.SECONDS)
Expand Down Expand Up @@ -1184,9 +1185,10 @@ public void verifyPhoneNumberForMultiFactor(
rejectPromiseWithCodeAndMessage(promise, "unknown", "can't find session for provided key");
return;
}

FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(firebaseApp);
final PhoneAuthOptions phoneAuthOptions =
PhoneAuthOptions.newBuilder()
PhoneAuthOptions.newBuilder(firebaseAuth)
.setPhoneNumber(phoneNumber)
.setActivity(getCurrentActivity())
.setTimeout(30L, TimeUnit.SECONDS)
Expand Down
Loading