简体   繁体   中英

Firebase user authentication with AngularFire

I am trying to authenticate the user through Github using AngularFire but I keep getting the error:

ref.authWithOAuthPopup is not a function

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。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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