Skip to content

Commit

Permalink
fix!: enrolledFactors rather than enrolledFactor
Browse files Browse the repository at this point in the history
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

BREAKING CHANGE: runtime MFA user property renamed from `enrolledFactor` to `enrolledFactors` and now matches typescript types
  • Loading branch information
mnahkies committed Feb 26, 2024
1 parent fc2c857 commit 07aa603
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/auth/lib/multiFactor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class MultiFactorUser {
user = auth.currentUser;
}
this._user = user;
this.enrolledFactor = user.multiFactor.enrolledFactors;
this.enrolledFactors = user.multiFactor.enrolledFactors;

Check warning on line 17 in packages/auth/lib/multiFactor.js

View check run for this annotation

Codecov / codecov/patch

packages/auth/lib/multiFactor.js#L17

Added line #L17 was not covered by tests
}

getSession() {
Expand Down

0 comments on commit 07aa603

Please sign in to comment.