password must be a string joi validation error code example
Example 1: joi validation compare two password
password: Joi.string().required(),
confirmPassword:Joi.string().required().valid(Joi.ref('password')),
Example 2: joi schema for confirm password
password: Joi.string().min(3).max(15).required(),
password_confirmation: Joi.any().valid(Joi.ref('password')).required().options({ language: { any: { allowOnly: 'must match password' } } })