Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

[Ioniv 4] How to properly clear the cache when logout

$
0
0

@devmob-firb wrote:

Hi, when I logout with a user-A and then login with another user (user-B) I still see this user-B data/views. How can I properly clear the cache when the user logout? This is my logout() method written in a service:

logout(): {
    this.token$ = null;
    this.user$ = null;
    this.storage.removeLocalItem('currentUser');
    this.storage.removeLocalItem('currentUserHealthProfessionals');
    this.storage.removeLocalItem('token');
    this.storage.removeLocalItem('mfa_token');
    this._router.navigate(['/login'], { clearHistory: true } as NavigationExtras);
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>