From 5fa806d33e60422be07291987a018498042a131d Mon Sep 17 00:00:00 2001 From: Apoorv Taneja Date: Thu, 17 Oct 2019 22:23:11 +0530 Subject: [PATCH] Password limit (#1191) * changes * changes * changes * changes * changes * changez --- client/utils/reduxFormUtils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/utils/reduxFormUtils.js b/client/utils/reduxFormUtils.js index 06776e0d..8ff4b0a9 100644 --- a/client/utils/reduxFormUtils.js +++ b/client/utils/reduxFormUtils.js @@ -44,7 +44,9 @@ export function validateSettings(formProps) { if (formProps.currentPassword && !formProps.newPassword) { errors.newPassword = 'Please enter a new password or leave the current password empty.'; } - + if (formProps.newPassword && formProps.newPassword.length < 6) { + errors.newPassword = 'Password must be at least 6 characters'; + } return errors; } @@ -67,10 +69,8 @@ export function validateSignup(formProps) { if (!formProps.password) { errors.password = 'Please enter a password'; } - if (formProps.password) { - if (formProps.password.length < 6) { - errors.password = 'Password must be at least 6 characters'; - } + if (formProps.password && formProps.password.length < 6) { + errors.password = 'Password must be at least 6 characters'; } if (!formProps.confirmPassword) { errors.confirmPassword = 'Please enter a password confirmation';