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 === "") {
return
}
if (confirm.length < props.passwordLength) {
if (password.length < props.passwordLength) {
props.setMessage(passwordTooShortMessage)
return;
}
if (props.passwordRequireCapital && !/[A-Z]/.test(confirm)) {
if (props.passwordRequireCapital && !/[A-Z]/.test(password)) {
props.setMessage(passwordRequiresCapitalMessage)
return;
}
if (props.passwordRequireNumeric && !/\d/.test(confirm)) {
if (props.passwordRequireNumeric && !/\d/.test(password)) {
props.setMessage(passwordRequiresNumericMessage)
return;
}
if (props.passwordRequireSpecial) {
if (!props.passwordValidSpecialCharacters.split("").some(v => confirm.includes(v))) {
if (!props.passwordValidSpecialCharacters.split("").some(v => password.includes(v))) {
props.setMessage(passwordRequiresSpecialMessage)
return;
}