37 lines
926 B
TypeScript
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
|
|
}
|