Skip to main content

VerifyEmailDTO

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

Data transfer objects for email verification: verify with code, verify with token, and resend verification email.

import { VerifyEmailWithCodeDTO, VerifyEmailWithTokenDTO, ResendVerificationEmailDTO } from '@nauth-toolkit/nestjs';

VerifyEmailWithCodeDTO

Verify email with 6-digit code.

PropertyTypeRequiredDescription
emailstringYesEmail address. Valid email format. Max 255 characters. Trimmed and lowercased.
codestringYesVerification code. Max 6 numeric characters. Whitespace removed.
challengeSessionIdnumberNoLinks verification to a specific challenge session. Positive integer if provided.

VerifyEmailWithTokenDTO

Verify email with URL token.

PropertyTypeRequiredDescription
tokenstringYesVerification token. Exactly 64 hexadecimal characters. Trimmed and lowercased.

ResendVerificationEmailDTO

Resend verification email. At least one of sub or email must be provided.

PropertyTypeRequiredDescription
substringNoUser identifier (UUID v4). Trimmed and lowercased. Required if email not provided.
emailstringNoEmail address. Valid email format. Max 255 chars. Required if sub not provided.
baseUrlstringNoBase URL for building a verification link. Must be valid http/https URL. Max 2048 chars.
challengeSessionIdnumberNoLinks verification to a specific challenge session. Positive integer if provided.

Example

Verify with Code:

{
"email": "user@example.com",
"code": "123456"
}

Verify with Token:

{
"token": "a1b2c3d4e5f6..."
}

Resend Email:

{
"email": "user@example.com"
}

Used By