Skip to content

Commit

Permalink
fix(auth, ios): reject multi-factor API call if session not found
Browse files Browse the repository at this point in the history
behavior should mirror what android native MFA does with this change
  • Loading branch information
mikehardy committed May 20, 2024
1 parent b815ea3 commit 3e397a4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/auth/ios/RNFBAuth/RNFBAuthModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3e397a4

Please sign in to comment.