Skip to content

Commit 3e8330d

Browse files
committed
feat: include phoneNumber from PhoneMultiFactorInfo
this is useful for indicating to users which phone number they have enrolled, and distinguishing between factors if there are multiple phone factors enrolled.
1 parent 57ed042 commit 3e8330d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

packages/auth/android/src/main/java/io/invertase/firebase/auth/ReactNativeFirebaseAuthModule.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2497,6 +2497,10 @@ private WritableMap multiFactorInfoToMap(MultiFactorInfo hint) {
24972497
hintMap.putString("factorId", hint.getFactorId());
24982498
hintMap.putString("uid", hint.getUid());
24992499

2500+
if (hint.getFactorId().equals(PhoneMultiFactorGenerator.FACTOR_ID)) {
2501+
hintMap.putString("phoneNumber", ((PhoneMultiFactorInfo) hint).getPhoneNumber());
2502+
}
2503+
25002504
return hintMap;
25012505
}
25022506

packages/auth/lib/index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,11 @@ export namespace FirebaseAuthTypes {
491491
uid: string;
492492
}
493493

494+
export interface PhoneMultiFactorInfo extends MultiFactorInfo {
495+
factorId: "phone";
496+
phoneNumber: string;
497+
}
498+
494499
export interface MultiFactorAssertion {
495500
token: string;
496501
secret: string;

0 commit comments

Comments
 (0)