Update a user
Updates user data for a logged in user.
- In order to use the
updateUser()
method, the user needs to be signed in first. - By default, email updates sends a confirmation link to both the user's current and new email. To only send a confirmation link to the user's new email, disable Secure email change in your project's email auth provider settings.
Parameters
attributes
REQUIRED
UserAttributesAttributes to update for the user.
email
Optional
StringThe new email address for the user.
phone
Optional
StringThe new phone number for the user.
password
Optional
StringThe new password for the user.
data
Optional
Map<String, dynamic>The user's metadata to be stored in the user's object.
nonce
Optional
StringThe nonce sent for reauthentication if the user's password is to be updated.
emailRedirectTo
Optional
StringThe URI to redirect the user to after the email is updated.
final UserResponse res = await supabase.auth.updateUser(
UserAttributes(
email: 'example@email.com',
),
);
final User? updatedUser = res.user;