简体   繁体   English

使用AngularFire进行Firebase用户身份验证

[英]Firebase user authentication with AngularFire

I am trying to authenticate the user through Github using AngularFire but I keep getting the error: 我正在尝试使用AngularFire通过Github对用户进行身份验证,但我不断收到错误消息:

ref.authWithOAuthPopup is not a function ref.authWithOAuthPopup不是一个函数

This is my controller code: 这是我的控制器代码:

.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);
}]);

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM