下面是我正在玩的示例代码:
var myRootRef = new Firebase('https://url.firebaseIO.com/');
var authClient = new FirebaseAuthClient(myRootRef, function(error, user) {
if (error) {
// an error occurred while attempting login
console.log(error);
} else if (user) {
// user authenticated with Firebase
console.log('User ID: ' + user.id + ', Provider: ' + user.provider);
} else {
// user is logged out
console.log('logged out!');
login();
}
});
function login(){
var email = "something@gmail.com";
var password = "123";
authClient.login('password', {
email: email,
password: password,
rememberMe: true
});
}
我回来的错误是:无法调用未定义的方法“登录”
authClient 似乎总是为空?我究竟做错了什么?