feat: implement password requirements on web (M2-10507)#719
feat: implement password requirements on web (M2-10507)#719sricharan-varanasi wants to merge 35 commits intodevfrom
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
c2df86e to
3e96322
Compare
adeiji
left a comment
There was a problem hiding this comment.
Everything looks great. Nice work! I just noted one potential issue with translations and maybe needing to use useTranslation().
divbzero
left a comment
There was a problem hiding this comment.
@sricharan-varanasi Looks good! Please take a look at the comments marked [Important] before merging. The other comments are minor so feel free to use your judgment on whether to make those changes.
Validate caseless characters in passwords as both uppercase and lowercase. This matches the behavior on the frontend: - ChildMindInstitute/mindlogger-admin#2207 - ChildMindInstitute/mindlogger-app-refactor#1089 - ChildMindInstitute/mindlogger-web-refactor#719
…2038) 🔗 [Jira Ticket M2-10505](https://mindlogger.atlassian.net/browse/M2-10505) Changes include: - Validate caseless characters in passwords as both uppercase and lowercase. This is a follow-up to pull request #2036. After thinking through @jodybrookover’s comments, seems to make sense to allow caseless characters in passwords to validate as both uppercase and lowercase letters. There tend to be more caseless characters than uppercase or lowercase letters, and this matches the behavior already implemented on the frontend with: - ChildMindInstitute/mindlogger-admin#2207 - ChildMindInstitute/mindlogger-app-refactor#1089 - ChildMindInstitute/mindlogger-web-refactor#719
…ng password checklist errors
| "passwordBlankSpaces": "A senha não deve conter espaços.", | ||
| "passwordCharacterTypes": "A senha deve conter pelo menos {{types}} de: maiúsculas, minúsculas, números, símbolos.", | ||
| "passwordMustInclude": "A senha deve incluir:", | ||
| "passwordMustInclude": "A palavra-chave deve conter no mínimo 10 caracteres, sem espaços, e pelo menos 3 dos 4 itens abaixo:", |
There was a problem hiding this comment.
[Important] Add passwordMustIncludeMinimum?
There was a problem hiding this comment.
(Minor) Parametrize the numbers in these translations?
| const passwordValue = useWatch({ control: form.control, name: 'password' }); | ||
|
|
||
| useEffect(() => { | ||
| clearErrors('password'); |
There was a problem hiding this comment.
Did we intentionally remove clearErrors here? I think we still clearErrors on the other forms.
…w error message on submit when password field is empty
…entsSection so that we dont have inconsistent behaviour within the app fixed bug: M2-106
…s in password policy check
📝 Description
🔗 Jira Ticket M2-10507
Changes include:
checkPassword) with NFC normalization - emoji counts as 1 char, caseless scripts (CJK, Arabic, Hebrew, etc.) count as both upper and lowercasePasswordRequirementsTooltipcomponent - real-time ✓/✗ checklist shown next to password fields on Signup, Recovery, and Change Password formsi18n.t()with interpolation params (matching admin pattern) - error messages now show correct min length per context (10 for new passwords, 6 for legacy/login)checkPassword🪤 Peer Testing
Sign up: Enter passwords and verify the tooltip appears next to the password field showing requirements updating in real-time. Try passwords shorter than 10 chars, with spaces, with fewer than 3 character types - each should show as ✗. A valid password (e.g.
MyPassword1!) should show all ✓.Login: Enter a password shorter than 6 characters - should show min length error with "6" in the message.
Change Password / Recovery Password: Same tooltip behavior as signup. Old password field accepts min 6 chars (legacy). New password enforces the full 10-char + complexity rules.
Language switching: Switch to fr/es/pt/el and verify error messages and tooltip text are translated with correct interpolated numbers.
✏️ Notes
Mirrors the admin PR implementation. Schemas are now factory functions (not module-level constants) so they can call
i18n.t()with{ chars }and{ types }params at creation time.