Validators_ResetPasswordValidator.js
const Schema= require('@d3v4pp/validate');
const { passwordMessages } = require('./ValidatorsMessagesFR');
/**
* @memberof Myintranet.Validators
*/
const ResetPasswordValidator = new Schema({
password: {
type: String,
required: true,
match:/^(?=.*[A-Z])(?=.*[-!#$@%&'*+/=?^_`{|}~])(?=.*[0-9])(?=.*[a-z]).{8,}$/,
length: {min: 8, max: 100},
message: passwordMessages
},
newPass: {
type: String,
required: true,
match:/^(?=.*[A-Z])(?=.*[-!#$@%&'*+/=?^_`{|}~])(?=.*[0-9])(?=.*[a-z]).{8,}$/,
length: {min: 8, max: 100},
message: passwordMessages
},
confirmPass: {
type: String,
required: true,
match:/^(?=.*[A-Z])(?=.*[-!#$@%&'*+/=?^_`{|}~])(?=.*[0-9])(?=.*[a-z]).{8,}$/,
length: {min: 8, max: 100},
message: passwordMessages
}
})
module.exports = ResetPasswordValidator;