Skip to content

Instantly share code, notes, and snippets.

@Klerith
Created July 16, 2022 16:32
Show Gist options
  • Save Klerith/c77edd9d86174aa68efbfddd21f053a2 to your computer and use it in GitHub Desktop.
Save Klerith/c77edd9d86174aa68efbfddd21f053a2 to your computer and use it in GitHub Desktop.
Password validation - DTO
@IsString()
@MinLength(6)
@MaxLength(50)
@Matches(
/(?:(?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, {
message: 'The password must have a Uppercase, lowercase letter and a number'
})
password: string;
@gabrielgjha1
Copy link

Bendiciones

@felipejoq
Copy link

Muchas gracias! 🤝

@manuelmtzv
Copy link

import {
IsStrongPassword,
} from 'class-validator';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment