From 6fc33261f9aafe7b23c7ea19cff34bb9f89e1ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Fri, 3 Dec 2021 19:07:21 +0000 Subject: [PATCH] fix: password confirmation step --- .../src/pages/Authentication/Register.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/new-lamassu-admin/src/pages/Authentication/Register.js b/new-lamassu-admin/src/pages/Authentication/Register.js index 92dab513..730294ca 100644 --- a/new-lamassu-admin/src/pages/Authentication/Register.js +++ b/new-lamassu-admin/src/pages/Authentication/Register.js @@ -42,18 +42,17 @@ const REGISTER = gql` } ` -const validationSchema = Yup.object().shape({ +const validationSchema = Yup.object({ password: Yup.string() .required('A password is required') .test( 'len', - 'Your password must contain more than 8 characters', + 'Your password must contain at least 8 characters', val => val.length >= 8 ), - confirmPassword: Yup.string().oneOf( - [Yup.ref('password'), null], - 'Passwords must match' - ) + confirmPassword: Yup.string() + .required('Please confirm the password') + .oneOf([Yup.ref('password')], 'Passwords must match') }) const initialValues = {