My app uses AngularFire to authenticate with email/password. After logging in, it shows a list of Firestore records (at least it’s supposed to) for the logged-in user.
What’s happening is that the first time I run it via ionic serve,
it works fine (shows the login screen, I enter email & password and login, it goes to the list page with the records shown). After updating the code & reloading, the records aren’t showing. I log out and log in again, and the records still won’t show.
I added the following to ngOnInit() see if I’m still logged in…
if (this.fAuth.auth.currentUser)
console.log("logged in user: ", this.fAuth.auth.currentUser.email);
else
console.log("Not logged in!!");
});
First time I log in, “logged in user” shows. After code update & reload, sometimes it says “Not logged in”, sometimes nothing shows! I added the same code to the constructor, no luck!
The only way to show the records is to stop the ionic serve
(via ctrl+c) and run it again.
What the heck? Is this a bug? How can I get it to always stay logged on, with the records showing everytime I update the code and it reloads??
Please help!