【问题标题】:$createUserWithEmailAndPassword when using AngularFire is creating user but isn't returning promise [duplicate]使用 AngularFire 时的 $createUserWithEmailAndPassword 正在创建用户但没有返回承诺 [重复]
【发布时间】:2016-11-11 20:18:44
【问题描述】:

我目前正在将现有项目从以前的 Firebase.com 设置迁移到 Firebase 3/AngularFire 2。这是我第一次与每个人一起工作。

我的问题是:我正在使用 AngularFire 文档中的 $createUserWithEmailAndPassword 示例,并且希望在返回承诺后添加一个 updateProfile,但在最初的 $createUserWithEmailAndPassword 行之后我什么也没有发生。 “Auth”是我的工厂返回$firebaseAuth()

Auth.$signInWithEmailAndPassword($scope.user.email, $scope.user.password)
.then(function(firebaseUser) {
  console.log("Signed in as:", firebaseUser.uid);
}).catch(function(error) {
  console.error("Authentication failed:", error);
});

我正在通过 Firebase/Google 控制台确认正在添加 Auth 用户,但我的控制台中没有收到任何错误 - 只是没有返回任何承诺。有什么想法/建议吗?

【问题讨论】:

  • 你能不能也展示一下你的Auth工厂?
  • 可能有两个原因 1 Auth.$signInWithEmailAndPassword 没有返回承诺 2 Auth.$signInWithEmailAndPassword 没有解决其正文中的承诺..

标签: angularjs ionic-framework firebase angularfire firebase-authentication


【解决方案1】:

这似乎是一个已在上游修复的已知错误:https://github.com/firebase/angularfire/issues/790

也许您必须将您的库更新为2.0.1

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多