【问题标题】:Firebase admin sdk: created user shows up as anonymousFirebase admin sdk:创建的用户显示为匿名
【发布时间】: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


【解决方案1】:

同样的问题发生在我身上,我无法登录到我的应用程序,直到在我的项目控制台中激活匿名登录,所以,当您默认使用 creatUser() 函数时,它 createUser 为匿名

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-01-31
    • 2017-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-23
    相关资源
    最近更新 更多