prescottprue / react-redux-firebase

Redux bindings for Firebase. Includes React Hooks and Higher Order Components.
https://react-redux-firebase.com
MIT License
2.55k stars 559 forks source link

bug(types): profileFactory userData type definition incorrect #1000

Open mrjogo opened 3 years ago

mrjogo commented 3 years ago

Do you want to request a feature or report a bug?

bug

What is the current behavior?

The userData argument on the profileFactory callback is typed as AuthTypes.User, however the object that gets passed to the callback is AuthTypes.UserCredential.

What is the expected behavior?

The type definition of userData should be AuthTypes.UserCredential.

Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?

react-redux-firebase 3.7.0

mrjogo commented 3 years ago

Actually, playing around a little more, it seems userData is different types depending on the signup method. With createUser({ email: 'xxxx@xxxx.xxx', password: 'xxxx' }) it gets AuthType.UserCredential, but with login({ provider: 'google' }) it gets AuthType.User, or something like that.