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

Ionic 4: Log in as a different user, previous user's data still shows

$
0
0

My Ionic 4 app uses Firebase to authenticate, and data is stored in local storage after logging. Here’s the flow:

  • User A logs in
  • User A’s info is retrieved from Firebase, then stored locally in storage
  • User A logs out, and his info is cleared from storage by calling storage.clear()
  • User B logs in, but can still see User A’s info

How can I completely clear a user’s info after logging out, so that it doesn’t show when another user logs in???

The code that reads data from the storage to display is in the ngOnInit() function. I noticed that when logging in again as a different user, ngOnInit() isn’t called, so could that be why it’s not showing the new user’s data?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



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