checks against top password field rather than bottom

This commit is contained in:
Cam Otts 2023-05-22 14:24:54 -05:00
parent 64fbfbf1d3
commit 8c4134c8ad
No known key found for this signature in database
GPG Key ID: 367B7C7EBD84A8BD

View File

@ -15,20 +15,20 @@ const PasswordForm = (props) => {
if (confirm === "" && password === "") { if (confirm === "" && password === "") {
return return
} }
if (confirm.length < props.passwordLength) { if (password.length < props.passwordLength) {
props.setMessage(passwordTooShortMessage) props.setMessage(passwordTooShortMessage)
return; return;
} }
if (props.passwordRequireCapital && !/[A-Z]/.test(confirm)) { if (props.passwordRequireCapital && !/[A-Z]/.test(password)) {
props.setMessage(passwordRequiresCapitalMessage) props.setMessage(passwordRequiresCapitalMessage)
return; return;
} }
if (props.passwordRequireNumeric && !/\d/.test(confirm)) { if (props.passwordRequireNumeric && !/\d/.test(password)) {
props.setMessage(passwordRequiresNumericMessage) props.setMessage(passwordRequiresNumericMessage)
return; return;
} }
if (props.passwordRequireSpecial) { if (props.passwordRequireSpecial) {
if (!props.passwordValidSpecialCharacters.split("").some(v => confirm.includes(v))) { if (!props.passwordValidSpecialCharacters.split("").some(v => password.includes(v))) {
props.setMessage(passwordRequiresSpecialMessage) props.setMessage(passwordRequiresSpecialMessage)
return; return;
} }