Yup schema validation password and confirmPassword doesn’t work

import * as Yup from 'yup'; import User from '../models/User'; class UserController { async store(req, res) { const schema = Yup.object().shape({ name: Yup.string().required(), email: Yup.string() .email() .required(), password: Yup.string() .required() .min(6), }); if (!(await schema.isValid(req.body))) { return res.status(400).json({ error: 'Validation fails' }); } const userExists = await User.findOne({ where: { email: req.body.email } }); if … Read more