add validation for password length (#9798)

This commit is contained in:
Anantshree Chandola 2024-05-21 12:50:56 +05:30 committed by GitHub
parent 323be47e64
commit 2e6f4510dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,4 @@
import { IsEmail, IsNotEmpty, IsOptional, IsString, IsUUID, MinLength } from 'class-validator';
import { IsEmail, IsNotEmpty, IsOptional, IsString, IsUUID, MinLength, MaxLength } from 'class-validator';
import { lowercaseString } from 'src/helpers/utils.helper';
import { Transform } from 'class-transformer';
@ -31,6 +31,7 @@ export class AppSignupDto {
@IsString()
@IsNotEmpty()
@MinLength(5, { message: 'Password should contain more than 5 letters' })
@MaxLength(100, { message: 'Password length should not be more than 100 ' })
password: string;
@IsOptional()