class-validator-password-check
v1.0.8
Published
Helps with password validation with validation requirements like including uppercase letters, lowercase letter, number and special characters
Downloads
2,692
Readme
class-validator-password-check
Password Validator using class-validator
Installation
Module installation
$ npm install class-validator-password-check --save
$ yarn add class-validator-password-check
(or the short way):
npm i -S class-transformer-validator
Peer dependencies
This package is only a simple plugin/wrapper, so you have to install the required modules too because it can't work without them. See detailed installation instruction for the modules installation:
import { PasswordValidation, PasswordValidationRequirement } from 'class-validator-password-check'
var passwordRequirement: PasswordValidationRequirement = {
mustContainLowerLetter: true,
mustContainNumber: true,
mustContainSpecialCharacter: true,
mustContainUpperLetter: true
}
export class UserRegisterDto {
@IsString()
@MinLength(6)
@MaxLength(20)
@Validate(PasswordValidation, [passwordRequirement])
readonly password: string;
}
Todos
- Add minimium length
- Make special character dynamic
License
MIT