Skip to main content

UserResponseDTO

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

Sanitized user object for API responses. Excludes all sensitive and internal fields.

import { UserResponseDTO } from '@nauth-toolkit/nestjs';

Properties

PropertyTypeRequiredDescription
substringYesUser identifier (UUID v4).
emailstringYesEmail address.
usernamestring | nullNoUsername (optional).
firstNamestring | nullNoFirst name (optional).
lastNamestring | nullNoLast name (optional).
phonestring | nullNoPhone number in E.164 format (optional).
isEmailVerifiedbooleanYesEmail verification status.
isPhoneVerifiedbooleanYesPhone verification status.
isActivebooleanYesAccount active status.
isLockedbooleanYesWhether the account is locked.
mfaEnabledbooleanYesMFA enabled status.
mfaExemptbooleanYesWhether the user is exempt from MFA requirements.
socialProvidersstring[] | nullNoLinked social providers (optional).
hasPasswordHashbooleanYesWhether user has password set.
createdAtDateYesAccount creation timestamp.
updatedAtDateYesLast account update timestamp.

Example

{
"sub": "a21b654c-2746-4168-acee-c175083a65cd",
"email": "user@example.com",
"username": "johndoe",
"firstName": "John",
"lastName": "Doe",
"phone": "+14155552671",
"isEmailVerified": true,
"isPhoneVerified": true,
"isActive": true,
"isLocked": false,
"mfaEnabled": false,
"mfaExempt": false,
"socialProviders": ["google"],
"hasPasswordHash": true,
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-15T12:00:00.000Z"
}

Used By