Firebase
3
Вклад в тег
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
}
}