import * as Yup from 'yup'

const userValidation = Yup.object({
  name: Yup.string()
    .required('Required')
    .max(40, 'Must be 40 characters or less'),
  email: Yup.string()
    .email('Invalid email address')
    .required('Required'),
  password: Yup.string()
    .min(4, 'Must have at least 8 characters'),
  passwordAgain: Yup.string()
    .oneOf([Yup.ref('password'), null], 'Passwords must match')
})

export { userValidation }
