The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/auth > Auth > updateCurrentUser

Auth.updateCurrentUser() method

Asynchronously sets the provided user as Auth.currentUser on the Auth instance.

Signature:

updateCurrentUser(user: User | null): Promise<void>;

Parameters

Parameter Type Description
user User | null The new User.

Returns:

Promise<void>

Description

A new instance copy of the user provided will be made and set as currentUser.

This will trigger Auth.onAuthStateChanged() and Auth.onIdTokenChanged() listeners like other sign in methods.

The operation fails with an error if the user to be updated belongs to a different Firebase project.