diff --git a/libraries/nestjs-libraries/src/dtos/auth/create.org.user.dto.ts b/libraries/nestjs-libraries/src/dtos/auth/create.org.user.dto.ts index 0505e2b00..25f633a94 100644 --- a/libraries/nestjs-libraries/src/dtos/auth/create.org.user.dto.ts +++ b/libraries/nestjs-libraries/src/dtos/auth/create.org.user.dto.ts @@ -1,29 +1,31 @@ -import {IsDefined, IsEmail, IsString, MinLength, ValidateIf} from "class-validator"; +import {IsDefined, IsEmail, IsString, MaxLength, MinLength, ValidateIf} from "class-validator"; import {Provider} from '@prisma/client'; export class CreateOrgUserDto { - @IsString() - @MinLength(3) - @IsDefined() - @ValidateIf(o => !o.providerToken) - password: string; + @IsString() + @MinLength(3) + @MaxLength(64) + @IsDefined() + @ValidateIf((o) => !o.providerToken) + password: string; - @IsString() - @IsDefined() - provider: Provider; + @IsString() + @IsDefined() + provider: Provider; - @IsString() - @IsDefined() - @ValidateIf(o => !o.password) - providerToken: string; + @IsString() + @IsDefined() + @ValidateIf((o) => !o.password) + providerToken: string; - @IsEmail() - @IsDefined() - @ValidateIf(o => !o.providerToken) - email: string; + @IsEmail() + @IsDefined() + @ValidateIf((o) => !o.providerToken) + email: string; - @IsString() - @IsDefined() - @MinLength(3) - company: string; + @IsString() + @IsDefined() + @MinLength(3) + @MaxLength(128) + company: string; }