【发布时间】:2017-04-30 13:38:43
【问题描述】:
我正在使用电子邮件/密码进行身份验证,如下所示:
firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
// Handle Errors here.
});
并在此处收听 auth:
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
// User is signed in.
console.log(user);
} else {
// No user is signed in.
console.log("Not signed in");
}
});
效果很好。在检查 auth 返回的用户对象时,uid 是一个随机字符串,有没有办法在我创建帐户时设置这个 uid?例如,uid="someUserName"?
谢谢
【问题讨论】:
标签: firebase firebase-authentication