2

I'm trying to load profile data via react redux firebase, but it doesn't work.

This is my function to create a new user:

firebase.createUser({ email, password }, { firstName, lastName })

That's the way I'm setting my store:

const rootReducer = combineReducers({ 
    auth: authReducer, 
    firestore: firestoreReducer, 
    firebase: firebaseReducer 
})

const store = createStore(
    rootReducer,
    compose(
        applyMiddleware(thunk.withExtraArgument({ getFirebase, getFirestore })),
        reduxFirestore(firebase, rrfConfig)
    )
)

Where fbConfig is config from firebase and rrConfig is:

const rrfConfig = { userProfile: 'users', useFirestoreForProfile: true }

After that I render it:

<Provider store={store}>
    <ReactReduxFirebaseProvider
        firebase={firebase}
        config={rrfConfig}
        dispatch={store.dispatch}
        createFirestoreInstance={createFirestoreInstance}
    >
        <HashRouter>
            <App/>
        </HashRouter>
    </ReactReduxFirebaseProvider>
</Provider>

What could be wrong? Firstname and lastname is in firestore database, but it doesn't load.

John
  • 21
  • 1
  • i have the same problem right now and i dont have any idea to figure out whats going on with it i did try everything but the userProfile is empty – scripter Jun 24 '20 at 17:33
  • 1
    I had the same problem I thought it was not working. I finally realized that as I am using test users for authentification, the current user did not have the corresponding key to fill the profile. You need you check that your auth UID is the same as the users doc collection id. I mean that it actually exist in the collection – rustyBucketBay Feb 12 '21 at 21:23
  • Man, this is a perfect example of why we should never code while tired. I just spent the last hour or more trying to figure out why I couldn't get the login screen I just had remade to work, and the issue whats that I was testing with an empty account. – MorenoMdz Mar 14 '21 at 02:38

0 Answers0