Answer the question
In order to leave comments, you need to log in
How to add additional information when registering in firebase?
Good day, how can I, when registering a new user in firebase, add a phone field or any other field I need (be it a type of something)
await app.auth().createUserWithEmailAndPassword(event.email, event.password)
Answer the question
In order to leave comments, you need to log in
Good afternoon
And if you add an email and a password like yours during registration,
await firebase.auth().createUserWithEmailAndPassword(email, password)
await firebase.database().ref(`/users/${uid}/userInfo`).set({
name, department, email
});
actions: {
async registrations({commit, dispatch}, {name, department, email, password}){
try{
await firebase.auth().createUserWithEmailAndPassword(email, password)
const uid = await dispatch('userId');
await firebase.database().ref(`/users/${uid}/info`).set({
name, department, email
});
}catch(e){
throw e
}
},
userId(){
const user = firebase.auth().currentUser
return user ? user.uid : null
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question