Skip to content

Commit bcea81e

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 2c1f48e commit bcea81e

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

+4
Original file line numberDiff line numberDiff line change
@@ -2507,6 +2507,10 @@ private WritableMap multiFactorInfoToMap(MultiFactorInfo hint) {
25072507
hintMap.putString("factorId", hint.getFactorId());
25082508
hintMap.putString("uid", hint.getUid());
25092509

2510+
if (hint.getFactorId().equals(PhoneMultiFactorGenerator.FACTOR_ID)) {
2511+
hintMap.putString("phoneNumber", ((PhoneMultiFactorInfo) hint).getPhoneNumber());
2512+
}
2513+
25102514
return hintMap;
25112515
}
25122516

packages/auth/lib/index.d.ts

+5
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)