【发布时间】:2018-10-05 00:32:32
【问题描述】:
我正在尝试使用 firebase 云功能中的 firebase admin sdk 创建一个具有电子邮件和密码的用户,该用户已创建,但即使我传递了电子邮件、密码和 displayName,它也会显示为匿名。我已经搜索并尝试了所有可能的结果,但结果相同,这是我的代码。
admin.auth().createUser({
email: "email",
password: "password",
displayName: "name"
})
我该如何解决这个问题?
提前致谢。
【问题讨论】:
-
添加
.then(function(userRecord) { // See the UserRecord reference doc for the contents of userRecord. console.log("Successfully created new user:", userRecord.uid); }) .catch(function(error) { console.log("Error creating new user:", error); });并控制台结果并在此处输入。 -
好吧,我已经有了那个代码,但是没有错误,用户创建成功并且uid也生成了,但是在firebase控制台中,用户显示为匿名。
-
以上双引号值需要设置正确的值。因此,密码必须最少六个字符,并且邮件格式也应该是正确的。是吗?
-
我尝试了有效的电子邮件和有效的密码,但仍然没有成功
-
检查 firebase 控制台,您的应用有权使用此身份验证:console.firebase.google.com/u/0/project/_/authentication/…
标签: node.js firebase firebase-authentication google-cloud-functions firebase-admin