Firebase Authentication: get user latest data after login

Deepak Sharma

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?

Renaud Tarnec

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.

edited at
0

Comments

0 comments
Login to comment

Related

Login User with Firebase Authentication

Keep user data in Firebase after Authentication

Swift - Login with FireBase - Can't retrieve user data after login

Get data of user after login in PHP

Firebase - How to write/read data per user after authentication

How to save new user data to Firebase Realtime Database after Login

get latest tweet of a user without authentication

Firebase authentication limit login by the same user

Problems with authentication flow in firebase app - after login, active user initially returns as null

User access to login page after authentication

AWS Cognito - Get user data after login with SignInUI

How to get user data after login with Twitter API

How to get user data after login in php with session

Load user data after login

access user google sheets after firebase authentication

Can't get user data after creating it using Firebase

Get user detail in after user login TWITTER

How to get the authentication id of a user with a LOCAL session in Firebase after reloading the site?

Firebase saying user is null after successful login

Trying to get the status of firebase user authentication

Get updated User from Firebase Authentication

How to get the user id from the firebase authentication

Firebase Authentication on nodejs, how to login a user and use mongodb?

Angular JS and SpringBoot, get User after authentication

get user detail from github after authentication

Access scope data after Firebase authentication

MYSQL 5.6 get latest data of each user

Data not stored in Firestore but the user's authentication info is available in Firebase authentication

SwiftUI Firebase Authentication dismiss view after successfully login