Mpondomise Mpondomise - 1 month ago 14
AngularJS Question

angularjs firebase authentication cookies are persistent into the next user session

The problem is when a user 1 has signed out, and once the user 2 signs in, either the info of the user 2 is not show, or the info of user 1 is still shown. Apparently the cookies from the first user still hang around and prevent the transition softly.
here is my signout controller, does anyone have any improvements on this?

app.controller("MysignOutCtrl", ["$scope",function ($scope) {
$scope.signOut = function () {
firebase.auth().signOut().then(function() {
console.log("Sign-out successful");
}, function(error) {
toastr.error(error.message, error.reason, { timeOut: 10000 });
})
};
}]);

AHC AHC
Answer

add the localStorage.clear(); after signout.