【发布时间】:2014-05-06 15:01:53
【问题描述】:
我想创建包含用户 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() 调用后用户等于 null。
【问题讨论】:
-
您的 $login() 代码在哪里? $login 的承诺中返回了什么,catch/finally 块呢?控制台出现什么错误?
-
$login() 是标准的 auth.$login (auth 从 $firebaseSimpleLogin 返回
-
您需要详细回答这些问题才能获得帮助;我们需要能够验证和重现问题,以确定您需要采取什么措施来解决它。
标签: angularjs firebase firebase-security