Files
bookorbit/server/src/modules/auth/dto/setup.dto.ts
T

25 lines
506 B
TypeScript

import { IsEmail, IsString, Matches, MaxLength, MinLength } from 'class-validator';
export class SetupDto {
@IsString()
@MinLength(3)
@MaxLength(100)
username: string;
@IsString()
@MinLength(1)
@MaxLength(255)
name: string;
@IsEmail()
email: string;
@IsString()
@MinLength(8)
@MaxLength(1024)
@Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/, {
message: 'Password must contain at least one uppercase letter, one lowercase letter, and one digit',
})
password: string;
}