Skip to content

Commit 1ae7481

Browse files
authored
fix(auth): deprecate MultiFactorUser.enrolledFactor should be plural enrolledFactors (#7652)
* fix!: enrolledFactors rather than enrolledFactor the typescript definitions specify it as `enrolledFactors` reflecting that it is an array, but the javascript was actually setting it as `enrolledFactor` at runtime. ref: - typings: https://github.com/invertase/react-native-firebase/blob/main/packages/auth/lib/index.d.ts#L568 - android: https://github.com/invertase/react-native-firebase/blob/main/packages/auth/android/src/main/java/io/invertase/firebase/auth/ReactNativeFirebaseAuthModule.java#L2476 - ios: https://github.com/invertase/react-native-firebase/blob/main/packages/auth/ios/RNFBAuth/RNFBAuthModule.m#L1681 - web sdk: https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth/src/mfa/mfa_user.ts#L34
1 parent 21a9454 commit 1ae7481

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/auth/lib/multiFactor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export class MultiFactorUser {
1414
user = auth.currentUser;
1515
}
1616
this._user = user;
17+
this.enrolledFactors = user.multiFactor.enrolledFactors;
18+
// @deprecated kept for backwards compatibility, please use enrolledFactors
1719
this.enrolledFactor = user.multiFactor.enrolledFactors;
1820
}
1921

0 commit comments

Comments
 (0)