I am signing in a user with Firebase’s signInWithEmailAndPassword() and then get that users information with
var fbuser = this.afAuth.auth.currentUser;. However, the call is asynchronous, so in order for fbuser to contain the newly submitted information, I have to call a wait function for 5 seconds to allow enough time for the user to be assigned the current user. This is obviously an awful way to do this but I can’t find anything on how to wait for fbuser to be valid. Any help would be great, thanks.
Here is the my login.ts: https://github.com/CSFoodRescueCapstone/foodfinder/blob/master/src/pages/login/login.ts