【问题标题】:Firebase user authentication with AngularFire使用 AngularFire 进行 Firebase 用户身份验证
【发布时间】:2015-08-28 19:07:22
【问题描述】:

我正在尝试使用 AngularFire 通过 Github 对用户进行身份验证,但我不断收到错误消息:

ref.authWithOAuthPopup 不是函数

这是我的控制器代码:

.controller('HomeCtrl', ['$scope', function($scope) {
    var ref = new Firebase("https://<MY-FIREBASE-APP>.firebaseio.com");
    function authHandler(error, authDat) {
        if (error) {
            console.log("Login Failed!", error);
        } else {
            console.log("Authenticated successfully with payload: ", authData);
        }
    }
    ref.authWithOAuthPopup("github", authHandler);
}]);

【问题讨论】:

  • 您能否创建一个 jsfiddle 或 jsbin 来重现此内容,以及您使用的 AngularFire 版本的详细信息?
  • 我不认为我可以为我的项目创建一个 jsfiddle,但我的 angularfire 版本是 0.8.0

标签: javascript angularjs firebase angularfire


【解决方案1】:

原来我使用的是旧版本或 firebase 本身……我使用的是 1.0.18 版本,而当前版本是 2.2.9。

【讨论】:

    猜你喜欢
    • 2016-04-08
    • 1970-01-01
    • 1970-01-01
    • 2020-10-09
    • 2017-03-11
    • 2018-10-19
    • 2021-05-26
    • 2017-09-12
    • 2021-07-20
    相关资源
    最近更新 更多