Answer the question
In order to leave comments, you need to log in
How do I add an admin role when creating a user?
I'm working on the project. You need to somehow make the admin role in firebase. The user is created like this:
async createUser(context, { email, password, user}) {
try {
console.log('user', user)
await firebase
.auth()
.createUserWithEmailAndPassword(email, password);
const userFirebase = firebase.auth().currentUser;
userFirebase.updateProfile({
displayName: user
})
setUserToState(context, user);
/* setUserToState(context, responce); */
} catch (error) {
console.log('error', error)
throw error.message;
}
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question