Skip to content

[🐛] Auth iOS verifyPhoneNumberWithMultiFactorInfo invalid-phone-number error #7546

Open
@bthurlow

Description

@bthurlow

RN: 0.72.7
RNFB: 18.7.3
iOS: 17.x

There appears to be an issue with the decoding of the MultifactorInfo on iOS when performing the MFA sign-in flow, this code is working on Android, but on iOS it appears that the phone number coming over is formatted as +*******1234 and in turn is throwing the invalid-phone-number error when calling the verifyPhoneNumberWithMultiFactorInfo method.

Tested on device and simulator with the same result.

The code below is based on the official documentation from here: https://rnfirebase.io/auth/multi-factor-auth

const mfaResolver = auth().getMultiFactorResolver(error);
            if (mfaResolver?.hints[0].factorId === auth.PhoneMultiFactorGenerator.FACTOR_ID) {
              const hint = mfaResolver.hints[0];
              const sessId = mfaResolver.session;
              auth()
                .verifyPhoneNumberWithMultiFactorInfo(hint, sessId)
                .then((vId) => {
                  setVerificationId(vId);
                  setMfaResolver(mfaResolver);
                  setShowVerificationForm(true);
                })
}

Ideas or assistance is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions