Exit with Firebase
I am trying to auth a user and now I am logging into the output
<button ng-click="logOut(user)">
GOING OUT
</button>
that's how they sign
$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;
};
and I'm trying to call logOut
$scope.logOut = function(user) {
ref.unauth();
};
As soon as I log out, I do not see messages or do not get into the "Network" section in the browser.
In Firebase Docs, all they say about logging out is
Registration of users outside
Calling unauth () cancels the user's token and displays it from the application:
Copy ref.unauth (); If you previously used the onAuth () method to listen for authentication status, your callback will now be called with a null value for authData.
so what should i do here?