Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import passwordValidator from 'password-validator'
import validator from 'validator'
import _ from 'lodash'
import {
User
} from '~/src/app/models/User/Model'
const passwordSchema = new passwordValidator()
passwordSchema
.is().min(8)
.is().max(64)
.has().not().spaces()
.has().uppercase()
.has().lowercase()
// .has().digits()
const passwordErrorsMessages = {
min: 'Password should be at least 8 charachters long',
max: 'Password should be be a maximum of 64 characters long',
uppercase: 'Password should have uppercase characters',
lowercase: 'Password should have lowercase characters',
digits: 'Password should contain digits',