I'm working on administrator web site, and Actually I need to know how to sign up users without losing my admin sign up, Cause I need to make only admin can create users accounts. I'm using firebase Email/Pw authentification.
const CreateCh = document.querySelector('#CreateChaufeurs');
CreateCh.addEventListener('submit',(e)=>{
e.preventDefault();
//get chaufeur info
const email = CreateCh['exampleEmail11'].value;
const password = CreateCh['examplePassword11'].value;
const Fname = CreateCh['Fname'].value;
const Address = CreateCh['exampleAddress'].value;
const Tel = CreateCh['exampleAddress2'].value;
const Ville = CreateCh['exampleCity'].value;
const Etat = CreateCh['exampleState'].value;
const Cp = CreateCh['exampleZip'].value;
const AGE = CreateCh['AGE'].value;
console.log(password, email, Fname,AGE,Address,Tel,Ville,Etat,Cp );
firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// ...
});
});
but after the creation of the account, it automatically logs in with that new account.