Home > @firebase/auth > updateCurrentUser
updateCurrentUser() function
Asynchronously sets the provided user as Auth.currentUser on the Auth instance.
Signature:
export declare function updateCurrentUser(auth: Auth, user: User | null): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
auth | Auth | The Auth instance. |
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 onAuthStateChanged() and 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.