Archived
2

changed password policy

This commit is contained in:
VLE2FE
2020-08-07 10:54:01 +02:00
parent 4ce65ad7cc
commit 1396fb0326
2 changed files with 6 additions and 7 deletions

View File

@ -17,9 +17,8 @@ export default class UserValidate { // validate input for user
.max(128),
pass: Joi.string()
.pattern(/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[!"#%&'()*+,-.\/:;<=>?@[\]^_`{|}~])(?=\S+$)[a-zA-Z0-9!"#%&'()*+,\-.\/:;<=>?@[\]^_`{|}~]{8,}$/)
.max(128)
.messages({'string.pattern.base': 'password must have at least 8 characters, one uppercase and one lowercase character, one number and at least one of the following characters: !"\\#%&\'()*+,-.\\/:;<=>?@[]^_`\\{|}~'}),
.min(8)
.max(128),
level: Joi.string()
.valid(...globals.levels),