0

I am creating a site using react-redux-firebase, and when a user logs in with facebook I want to create a profile that stores a user choice. I know how to define what to store with the profileFactory, but I don't know how to pass dynamic data coming from the user. In my case I want to save the users' language. My configuration is similar to this:

const config = {
  userProfile: 'users', // where profiles are stored in database
  profileFactory: (userData, profileData) => { // how profiles are stored in database
    const { user } = userData
    return {
      language: [i need to put here what the user chose]
      email: user.email
    }
  }
}

The configuration was based on this recipe.

When logging in I'm using type redirect.

 await firebase.login({
        provider: 'facebook',
        type: 'redirect'
      })

How could I save the user choice when the user is created?

Artur Carvalho
  • 6,901
  • 10
  • 76
  • 105

1 Answers1

1

To solve the user custom fields I'm creating a user when the redirect comes back from facebook.

I'm still not totally sure this is the best way to do it. Seems odd that I can define a profileFactory but can't pass user custom fields in some way.

Artur Carvalho
  • 6,901
  • 10
  • 76
  • 105