我正在尝试进行用户身份验证,现在我正在注销
<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; };
$scope.logout = function(user) { ref.unauth(); };
一旦我呼叫退出,我没有看到任何帖子或进入浏览器的网络部分.
在Firebase文档中,他们所说的注销就是这个
Logging Users Out
Calling unauth() invalidates the user’s token and logs them out of your application:
Copy
ref.unauth();
If you had prevIoUsly used the onAuth() method to listen for authentication state,your callback would now be invoked with null for authData.
那我该怎么办?