How to clear cache to make a "logout"?

Hello everyone,

I’m doing a tutorial of Ionic but cannot get ride from my cache (im always logged in), but i want to do some “clear()” function at console on browser but it doesnt work, how to do that to play between the pages Login and Register? Thank you so much

Regards

What authentication platform are you currently using?

Firestore (Firebase)

localstorage.clear();
Then take the user back to the login page by setting it as root.

this.navCtrl.setRoot('LoginPage);

It doesnt work sorry

AugularFireAuth has an auth property.

you will need to inject the AuthFireAuth in your constructor…

and during the logout method:

use auth.auth.signOut().then(() => {
this.storageProvider.clearAll();
});

1 Like