angularjs – 使用Firebase注销
我正在尝试进行用户身份验证,现在我正在注销
<button ng-click="logOut(user)"> GOING OUT </button> 这是他们如何登录 $scope.signIn = function (user) { $scope.signInErrorShow = false; if (user && user.email && user.pwdForLogin) { auth.$authWithPassword({ email: user.email,password: user.pwdForLogin }).then(function (authData) { console.log("Logged in as:" + authData.password.email); ref.child("users").child(authData.uid).once('value',function (snapshot) { var val = snapshot.val(); $scope.$apply(function () { $rootScope.displayName = val; }); }); $scope.userLogin = true; $ionicLoading.hide(); $scope.closeModal(); $rootScope.$broadcast(''); }).catch(function (error) { $ionicLoading.hide(); }); } else $scope.signInErrorShow = true; }; 而我正在尝试调用logOut $scope.logOut = function(user) { ref.unauth(); }; 一旦我呼叫退出,我没有看到任何帖子或进入浏览器的网络部分. 在Firebase文档中,他们所说的注销就是这个
那我该怎么办? 解决方法
关于注销没有显示任何网络活动:在登录时,firebase可能会在您登录时为您提供访问令牌(由firebase客户端脚本保留).
登录后,您的应用程序访问firebase,它会将此标记添加到您的请求标头(授权标头?). 注销firebase客户端脚本时,只需删除令牌即可.这样,firebase后端不必在其(分布式)服务器上保持会话状态.他们只需要检查每个请求中发送的令牌的有效性. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 如何将函数应用于Scala中的多维数组的每个元组?
- 数组 – 如何在Scala中编写多态输入函数?
- scala – 如何在没有匹配器的情况下跳过specs2中的测试?
- scala – 通过类型成员而不是类型参数进行F限制量化?
- 在bash脚本中使用expect
- -bash: /usr/bin/yum: No such file or directory 完美解决
- 如何查看一个Application是32位的还是64位的?
- twitter-bootstrap – 使用Bootstrap Select禁用dropup功能
- Angular2:错误:模块’AppModule’声明的意外值’AppCompo
- scala – Spark:如何在循环中结合所有数据帧