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).
- NestJS
- Express
- Fastify
import { UpdateUserAttributesDTO, UserResponseDto } from '@nauth-toolkit/nestjs';
import { UpdateUserAttributesDTO, UserResponseDto } from '@nauth-toolkit/core';
import { UpdateUserAttributesDTO, UserResponseDto } from '@nauth-toolkit/core';
UpdateUserAttributesDTO (Request)
| Property | Type | Required | Description |
|---|---|---|---|
username | string | No | Username. 3-255 characters. Alphanumeric, underscores, and hyphens only. |
firstName | string | No | First name. 1-100 characters. Trimmed. |
lastName | string | No | Last name. 1-100 characters. Trimmed. |
email | string | No | Email address. Valid email format. |
phone | string | No | Phone number. E.164 format. |
metadata | object | No | Custom metadata. Merged with existing metadata. Set key to null to delete. |
preferredMfaMethod | string | No | Preferred MFA method. One of: totp, sms, email, passkey. |
retainVerification | boolean | No | Whether to retain email/phone verification status when updating email/phone. Default: false. |
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"
}
}