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