Skip to main content

UpdateUserAttributesDTO

Package: @nauth-toolkit/core Type: DTO (Request/Response)

Data transfer objects for user-initiated profile updates. Extends UserUpdateDTO without requiring sub (uses authenticated user context).

import { UpdateUserAttributesDTO, UserResponseDto } from '@nauth-toolkit/nestjs';

UpdateUserAttributesDTO (Request)​

PropertyTypeRequiredDescription
usernamestringNoUsername. 3-255 characters. Alphanumeric, underscores, and hyphens only.
firstNamestringNoFirst name. 1-100 characters. Trimmed.
lastNamestringNoLast name. 1-100 characters. Trimmed.
emailstringNoEmail address. Valid email format.
phonestringNoPhone number. E.164 format.
metadataobjectNoCustom metadata. Merged with existing metadata. Set key to null to delete.
preferredMfaMethodstringNoPreferred MFA method. One of: totp, sms, email, passkey.

Changing email or phone here always resets the corresponding verification flag and triggers re-verification. Retaining verification across a change is an administrator-only capability — see AdminUpdateUserAttributesDto's retainVerification.

UserResponseDto (Response)​

Returns the updated user object. See UserResponseDto for full structure.

Example​

{
"username": "newusername",
"firstName": "John",
"lastName": "Doe",
"metadata": {
"department": "Engineering",
"role": "Senior Developer"
}
}

Used By​