Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix / old password form error after validation #166

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

MelissaDTH
Copy link

@MelissaDTH MelissaDTH commented Mar 28, 2024

This PR

  • Adds a missing translation for when the old password is not correct after submitting the 'Password reset' form (I've used the error message obtained from the API)
  • Updates the password fields to include the autocomplete attribute to improve accessibility
  • Solves: OTT-1071

@royschut
Copy link

royschut commented Mar 28, 2024

You're now trying to match the filled in old password with the new password. That's never what we want, right? The user wants to change it.
We should let the backend validate the old password and just present the api error. You also don't need the translation then.
Edit: last statement was incorrect, you still need the translation. :)

@MelissaDTH
Copy link
Author

MelissaDTH commented Mar 28, 2024

You're now trying to match the filled in old password with the new password. That's never what we want, right? The user wants to change it. We should let the backend validate the old password and just present the api error. You also don't need the translation then.

Good point regarding the api error. I looked at the way it is currently done with the validation between the 2 new passwords. I will go back to the drawing board!

Update: discussed with Roy that we do need the translations in order to display the error in Spanish as well. We do now however take the 'old password does not match' api error in account and show it accordingly!

Copy link

@royschut royschut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, provided you undo the "passwords_do_not_match" update, and put its value into "old_password_does_not_match".

platforms/web/public/locales/es/account.json Outdated Show resolved Hide resolved
@MelissaDTH MelissaDTH temporarily deployed to Deployment Previews March 28, 2024 13:15 — with GitHub Actions Inactive
Copy link

@langemike langemike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Interesting to see that we missed the autocomplete attribute previously for the password field, but these thing can happen ;)

Copy link

@royschut royschut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@MelissaDTH MelissaDTH merged commit 081a52c into feat/accessibility-sprint-4 Apr 2, 2024
7 checks passed
@MelissaDTH MelissaDTH deleted the fix/old-password-validation branch April 2, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants