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

feat(profile): additionalUserInfo reachable in the profileFactory #385

Closed QuentinBrosse closed 1 year ago

QuentinBrosse commented 6 years ago

Do you want to request a feature or report a bug?
Feature (I think)

What is the current behavior?

When I login with facebook and the public_profile scope:

const response = await firebase.login({
  provider: 'facebook',
  type: 'popup',
  scopes: ['email', 'public_profile'],
});

I can access to the all the public_profile relative data in response.additionalUserInfo.profile.

What is the expected behavior?

It seems that these data are not available in the profileFactory arguments (neither in the userData nor in the profileData), it could be really useful in order to populate the profile with data relative to the scope(s) we chose. Is it my mistake or it is effectively the case ? If it is, I can send you a PL.

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

"react": "16.0.0",
"react-native": "0.50.4",
"react-native-firebase": "^3.1.1",
"react-redux": "^5.0.6",
"react-redux-firebase": "^2.0.0-beta.18",
"redux": "^3.7.2",
"redux-firestore": "0.1.0-beta.6",
prescottprue commented 6 years ago

Yeah, that totally makes sense, thanks for reporting. Haven't seen the use case so far, but it should be handled. Feel free to open a PR if you have the time.

QuentinBrosse commented 6 years ago

Yes, I need it so I will try to open a PR with week. :)

prescottprue commented 6 years ago

@QuentinBrosse After diving into it a little bit, I realized it may take a little bit of review to make sure we keep the surface API the same (otherwise it may need to be included in the next major version which is still a ways off).

Definitely open to a PR, but I'll update if I get a chance to look more at it.

CodeCutterUK commented 3 years ago

@prescottprue Has there been any progress towards this? Perhaps there is now an alternative approach to populate givenName, familyName, etc into the profile.

QuentinBrosse commented 3 years ago

@CodeCutterUK I don't use this project anymore sorry. :/ Maybe @prescottprue could help.

prescottprue commented 3 years ago

@CodeCutterUK You should be able to use the result from the promise of your call to login to then write data off to the profile (what the profile factory does)