From 6040976c07bd71ad801f10db4f219f7db66944a7 Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:29:10 +0300 Subject: [PATCH] add sign up password validator --- src/auth/dtos/user-auth.dto.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/auth/dtos/user-auth.dto.ts b/src/auth/dtos/user-auth.dto.ts index 729b735..1d6e2a5 100644 --- a/src/auth/dtos/user-auth.dto.ts +++ b/src/auth/dtos/user-auth.dto.ts @@ -1,5 +1,6 @@ import { ApiProperty } from '@nestjs/swagger'; import { IsEmail, IsNotEmpty, IsString } from 'class-validator'; +import { IsPasswordStrong } from 'src/validators/password.validator'; export class UserSignUpDto { @ApiProperty({ @@ -16,6 +17,10 @@ export class UserSignUpDto { }) @IsString() @IsNotEmpty() + @IsPasswordStrong({ + message: + 'password must be at least 8 characters long and include at least one uppercase letter, one lowercase letter, one numeric digit, and one special character.', + }) public password: string; @ApiProperty({