C
C
ceeed2021-09-13 19:03:01
firebase
ceeed, 2021-09-13 19:03:01

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;
  }
},

How can I add the admin role or is there another way to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
low molecular macro, 2021-09-13
@molekulyarniy

docks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question