File size: 671 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import { createZodDto } from "nestjs-zod/dto";
import { z } from "zod";
export const twoFactorSchema = z.object({
code: z
.string()
.length(6, { message: "Code must be a 6 digit number" })
.regex(/^\d+$/, { message: "Code must be a 6 digit number" }),
});
export class TwoFactorDto extends createZodDto(twoFactorSchema) {}
export const backupCodesSchema = z.object({
backupCodes: z.array(z.string().length(10)),
});
export class BackupCodesDto extends createZodDto(backupCodesSchema) {}
export const twoFactorBackupSchema = z.object({
code: z.string().length(10),
});
export class TwoFactorBackupDto extends createZodDto(twoFactorBackupSchema) {}
|