Firebase不推荐使用FirebaseSimpleLogin,所以我们一直在尝试实现新的authWithOAuthPopup,但我们不断收到控制台错误: TypeError:未定义不是一个函数。
var app = angular.module("myApp", ["firebase"]);
app.controller("appCtrl", function($scope, $firebase) {
var ref = new Firebase("https://[forge].firebaseio.com/users");
// Login using Google
$scope.loginGoogle = function() {
console.log("Got into google login");
ref.authWithOAuthPopup("google", function(error, authData) {
console.log("yeah, we got in! " + user.uid);
}, {
remember: "sessionOnly",
scope: "email"
});
};
$scope.logout = function() {
ref.unauth();
};
});我做错了什么?
发布于 2014-11-11 05:50:42
委派的身份验证方法(即通过OAuth提供商或电子邮件/密码等进行身份验证)已于2014年10月3日添加到Firebase核心客户端库中,并将需要从该日期起的客户端库( web客户端的>= 1.1.0 )。
获取最新的web客户端库,并在https://www.firebase.com/docs/web/changelog.html上查看changelog。
发布于 2014-11-09 09:20:52
请确保使用最新版本的Firebase,否则它将无法理解ref.authWithOAuthPopup方法
这是最新的版本:https://cdn.firebase.com/js/client/2.0.2/firebase.js
https://stackoverflow.com/questions/26822071
复制相似问题