I'm trying to assert that 2 passwords match:
app.post('/users/signup', [
check('email', 'email is not valid')
.isEmail()
.trim(),
check('password')
.isLength({ min: 4 })
.withMessage('password must be at least 4 characters')
.equals('passwordConfirmation'),
], (req, res) => {
...
I'm using equals
but it is checking if password
actually equals the string 'passwordConfirmation'
not the value req.body.passwordConfirmation