-
-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(auth): expose signInAndRetrieveDataWithCredential method which dispatches actions #539
Comments
Calling There will need to be a method exposed for calling this auth method with automatic profile dispatches afterword, but in the meantime you should be able to use async loginWithFacebook() {
const data = await Expo.Facebook.logInWithReadPermissionsAsync('1132153153121515', { permissions: ['public_profile', 'email'] }
if (data.type === 'success') {
const creds = this.props.firebase.auth.FacebookAuthProvider.credential(data.token)
await this.props.firebase.auth().signInAndRetrieveDataWithCredential(creds)
// call profile update after login to write data to profile
const profile = { email: creds.email }
await this.props.firebase.updateProfile(profile)
}
this.props.navigation.navigate('Dashboard')
} |
@prescottprue ok I get it thanks! thought it would work out of the box("If you would like to have your users profiles go to Firestore instead of Real Time Database, you can enable the useFirestoreForProfile option when making store creator" - http://react-redux-firebase.com/docs/firestore.html) : ) data object has the following keys: expires, token, type The user data is available in the response from
|
@dancomanlive In order for it to "work out of the box" actions need to be dispatched, so I am going to reopen so we can track adding a top level method for it, since as you pointed out from the docs, that is the goal. Thanks for reporting! |
@prescottprue Great initiative :) |
@prescottprue I discovered this works out of the box:
The actions shown in the remote debugger:
(in the remote debugger's Diff I see: firebase: { errors: [ 0: null ]} )
(populates firebase.auth with user data and sets firebase.profile.isLoaded from true to false)
(sets firebase.profile.isLoaded from false to true)
(populates firebase.profile with user data) |
@dancomanlive great to know, thanks for posting. Most likely going to update the docs to show this |
Do you want to request a feature or report a bug?
A bug
What is the current behavior?
When I log in the the user profile is not stored automatically in Firestore according to useFirestoreForProfile option.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar.
I do not want to eject so I am using firebase from the Web SDK.
I use Rematch library
Login.js (this.props.firebase comes from react-redux-firebase)
What is the expected behavior?
There should be a users collection in Firestore named after the userProfile configuration setting in createStoreWithFirebase().
Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?
I am using all the latest versions of everything.
Note: everything else works as expected.
The text was updated successfully, but these errors were encountered: