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.