Files
dmail-api/src/modules/auth/DTO/create-two-factor.dto.ts
T
2025-07-26 16:57:56 +03:30

37 lines
926 B
TypeScript

import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsOptional, IsString } from "class-validator";
export class Setup2FADto {
@IsOptional()
@IsString()
@ApiPropertyOptional({ description: "TOTP issuer name", example: "DMail Service" })
issuer?: string;
@IsOptional()
@IsString()
@ApiPropertyOptional({ description: "TOTP label", example: "DMail Service" })
label?: string;
}
export class Enable2FADto {
@ApiProperty({ description: "TOTP token from authenticator app", example: "123456" })
@IsString()
token: string;
}
export class Verify2FADto {
@ApiProperty({ description: "TOTP token for verification", example: "123456" })
@IsString()
token: string;
}
export class UseBackupCodeDto {
@ApiProperty({ description: "Backup code", example: "abcd1234" })
@IsString()
code: string;
}
export class GenerateBackupCodesDto {
// Empty DTO for endpoint consistency
}