chore: 2fa added
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { IsBoolean, IsOptional, IsString } from "class-validator";
|
||||
|
||||
export class Setup2FADto {
|
||||
@ApiPropertyOptional({ description: "TOTP issuer name", example: "DMail Service" })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
issuer?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: "Generate fresh secret", default: false })
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
fresh?: boolean;
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user