diff --git a/packages/auth/ios/RNFBAuth/RNFBAuthModule.m b/packages/auth/ios/RNFBAuth/RNFBAuthModule.m index 3c95235ace..7425a1c021 100644 --- a/packages/auth/ios/RNFBAuth/RNFBAuthModule.m +++ b/packages/auth/ios/RNFBAuth/RNFBAuthModule.m @@ -892,8 +892,15 @@ - (void)invalidate { DLog(@"verifyPhoneNumberForMultifactor phoneNumber: %@", phoneNumber); DLog(@"verifyPhoneNumberForMultifactor sessionId: %@", sessionId); FIRMultiFactorSession *session = cachedSessions[sessionId]; - DLog(@"using instance VerifyPhoneNumberForMultifactor: %@", - firebaseApp.name)[[FIRPhoneAuthProvider providerWithAuth:[FIRAuth authWithApp:firebaseApp]] + if (session == nil) { + [RNFBSharedUtils rejectPromiseWithUserInfo:reject + userInfo:(NSMutableDictionary *)@{ + @"code" : @"invalid-multi-factor-session", + @"message" : @"can't find session for provided key" + }]; + return; + } + [[FIRPhoneAuthProvider providerWithAuth:[FIRAuth authWithApp:firebaseApp]] verifyPhoneNumber:phoneNumber UIDelegate:nil multiFactorSession:session