Angularjs Firebase SimpleAuth返回带有承诺的null

Angularjs Firebase SimpleAuth返回带有承诺的null,angularjs,firebase,firebase-security,Angularjs,Firebase,Firebase Security,我想创建包含用户ID的firebase引用。这是我的密码: var authref = new Firebase('https://myfunnyapp.firebaseio.com'); $scope.auth = $firebaseSimpleLogin(authref); $scope.auth.$getCurrentUser().then(function(user) { var ref = new Firebase('https://myfunnyapp.firebaseio.c

我想创建包含用户ID的firebase引用。这是我的密码:

var authref = new Firebase('https://myfunnyapp.firebaseio.com');
$scope.auth = $firebaseSimpleLogin(authref);

$scope.auth.$getCurrentUser().then(function(user) {
  var ref = new Firebase('https://myfunnyapp.firebaseio.com/events/' + user.id);
  $scope.events = $firebase(ref);
});
我使用promise回调来解析身份验证后的用户


当我已经登录时,刷新正常工作。但在auth.$login()之后,调用user等于null。

我自己找到了答案。要获得$login调用的响应,您必须向它提供回调函数。比如:

$scope.login = function() {
  $scope.auth.$login('facebook').then(function(user) {
    console.log(user);
  }, function(error) {
    console.error('Login failed: ', error);
  });
};

$login()代码在哪里?$login的承诺中返回了什么,catch/finally块如何?控制台中出现了哪些错误?$login()是standart auth。$login(auth从$firebasesimpleLogin返回)您需要详细回答这些问题以获得帮助;我们需要能够验证和重现该问题,以确定您需要做什么来解决它。