使用 AngularFire 进行 Firebase 用户身份验证
Firebase user authentication with AngularFire
我正在尝试使用 AngularFire 通过 Github 对用户进行身份验证,但我一直收到错误消息:
ref.authWithOAuthPopup is not a function
这是我的控制器代码:
.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。
我正在尝试使用 AngularFire 通过 Github 对用户进行身份验证,但我一直收到错误消息:
ref.authWithOAuthPopup is not a function
这是我的控制器代码:
.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。