implement password length requirements (#4551)
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
febe029ed4
commit
4c31527832
2 changed files with 6 additions and 0 deletions
|
@ -63,6 +63,8 @@ const RegisterForm = ({ onSubmit }: RegisterFormProps) => {
|
|||
|
||||
if (!values.password) {
|
||||
errors.password = 'Required';
|
||||
} else if (values.password.length < 8) {
|
||||
errors.password = 'Minimum of 8 characters required';
|
||||
} else if (passwordError) {
|
||||
errors.password = passwordError;
|
||||
}
|
||||
|
|
|
@ -30,9 +30,13 @@ const ResetPasswordForm = ({ onSubmit, userName }) => {
|
|||
if (!values.token) {
|
||||
errors.token = 'Required';
|
||||
}
|
||||
|
||||
if (!values.newPassword) {
|
||||
errors.newPassword = 'Required';
|
||||
} else if (values.newPassword.length < 8) {
|
||||
errors.password = 'Minimum of 8 characters required';
|
||||
}
|
||||
|
||||
if (!values.passwordAgain) {
|
||||
errors.passwordAgain = 'Required';
|
||||
} else if (values.newPassword !== values.passwordAgain) {
|
||||
|
|
Loading…
Reference in a new issue