<分区>
我在管理员网站上工作,实际上我需要知道如何在不丢失我的管理员注册的情况下注册用户,因为我需要让只有管理员可以创建用户帐户。 我正在使用 firebase 电子邮件/Pw 身份验证。
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;
// ...
});
});
但在创建帐户后,它会自动使用该新帐户登录。