-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[🐛] iOS App Crashes getting Multi-factor session for second factor enroll #8177
Comments
Interesting - seems like your approach is sound but I have to defer upstream, have you opened an issue / PR upstream in firebase-ios-sdk ? I've found them to be excellent to work with if you've got your details straight, and quick to integrate change if you propose good solutions |
I haven't yet. I was hopping to confirm it's the ios-sdk issue and not like I've implemented it wrong in rn-firebase |
Given you basically have an upstream patch that seems to work, this might be something worth a little pre-emptive ping for a headsup from @paulb777 - Paul, looks like a secondary / non-default app auth issue in MFA - not sure about you all upstream but at this layer the secondary-app pathways are exercised less frequently and MFA doubly-so, thus they are a frequent source of error despite the age of the code. Might be the same over there, and this might be a real issue that seems obvious on first glance ? |
Agreed that it looks like an issue to be getting user from Thanks @BlindDev and @mikehardy ! |
@BlindDev I made a PR at firebase/firebase-ios-sdk#14238 inspired by your suggestion. would you confirm that it fixes your use case? |
@paulb777 yes, it works as expected. Thank you! |
Issue
Getting a crash attempting to get MFA User session before enrolling second factor:
In our app we have two firebase projects (default and secondary). The app can dynamically switch between two projects:
All other methods for authentication including MFA verification (when second factor enrolled) work with both projects.
I managed to patch the iOS Pod and it fixed the issue, but I'm not sure if I did everything right and there are no security concerns with my approach.
It looks like when the app requests a multi-factor user session, it still tries to get the user from the default app instance.
In the
ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Swift/MultiFactor/MultiFactorSession.swift
I've added new class method:Then in the
ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Swift/MultiFactor/MultiFactor.swift
I've replaced old method for session with the new one:Project Files
Javascript
Click To Expand
package.json
:firebase.json
for react-native-firebase v6:iOS
Click To Expand
ios/Podfile
:# N/A
AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:21.6.1
Firebase
module(s) you're using that has the issue:e.g. Instance ID
TypeScript
?Y
&5.0.4
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: