Answer the question
In order to leave comments, you need to log in
How to add users to firebase?
Current state:
The auth module stores the user under which they entered the site.
It is added in the following way:
case SIGN_IN_SUCCESS: {
return state
.set("loading", false)
.set("user", action.payload.user) // добавление пользователя в состояние из firebase
.set("error", null);
}
Answer the question
In order to leave comments, you need to log in
I worked with firebase and I remember doing this
const authenticateWithEmailAndPassword = (email, password) => {
// console.log('authenticateWithEmailAndPassword',email, password)
return dispatch => {
dispatch({type: types.START_LOGIN});
firebaseAuth.signInWithEmailAndPassword(email, password)
.then(result => {
//Здесь вы ложите email и пасс пользователя в users/people/id данного пользователя
dispatch(signInEmailPasswordSuccess(result))
})
.catch(error => {
dispatch(signInError(error))
});
}
}
Now how to make it so that in the state, for example, in the users / people module, store all users who have registered
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question