I need to get the latest user data like - emailVerified
, displayName
, and profilePhoto
. User is already logged-in. I want some sort of event or may be a call to server to see, latest value of user profile data.
firebase.auth().currentUser.emailVerified
I was trying this, but its returning the value from local (cached values at login), not the latest value from server. One question is already there, but not answered. :(
how to get the latest firebase user authentication data from server?
You need to call the reload()
method, which is asynchronous and returns a Promise.
firebase.auth().currentUser.reload()
.then(() => {
if (firebase.auth().currentUser.emailVerified) {
//...
} else {
//...
}
});
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments