patch userValidator middleware to remove deprecated sanitize function
This commit is contained in:
parent
2c39fe1156
commit
7408e409aa
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
const {check, sanitize, validationResult} = require('express-validator');
|
||||
const {check, body, validationResult} = require('express-validator');
|
||||
|
||||
const signupValidationRules = () => {
|
||||
return [
|
||||
|
@ -7,7 +7,7 @@ const signupValidationRules = () => {
|
|||
check('password', 'invalid password').isString().isLength({min: 8}),
|
||||
check('confirmPassword', 'invalid password').isString()
|
||||
.custom((confirmPassword, { req }) => confirmPassword === req.body.password),
|
||||
sanitize('username').escape()
|
||||
body('username').escape()
|
||||
]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue