Ol' Reliable
Ol' Reliable

Reputation: 570

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

Upvotes: 0

Views: 137

Answers (1)

Ol&#39; Reliable
Ol&#39; Reliable

Reputation: 570

Turns out I was using an older version or firebase itself ... I was using version 1.0.18 while the current version is 2.2.9.

Upvotes: 0

Related Questions