Skip to content

fix(web,mobile): password change — restore missing messages, show each problem under its own input - #179

Merged
MITOM06 merged 4 commits into
mainfrom
fix/web-password-change-messages
Nov 1, 2026
Merged

MITOM06 merged 4 commits into
mainfrom
fix/web-password-change-messages

Conversation

@nguyenhoangdung245

@nguyenhoangdung245 nguyenhoangdung245 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Manual test on dev (2026-10-28), Settings → Password & Security:

  • A wrong current password threw next-intl MISSING_MESSAGE: Could not resolve settings.security.incorrectCurrent (dev overlay; production would render the raw key).
  • Submitting with only the current password filled showed the strength checklist's "≥8 characters" chip in a banner above the form, and an empty current password was never checked before the request.

Missing messages (web)

  • 732eb327 (2FA work) removed incorrectCurrent / currentRequired from settings.security and settings.changePasswordDialog in all 7 locales. A day later, 3e993aff added passwordChangeErrorKey(), which still returns both. They are back, with their original wording from 732eb327^.
  • The parity test cannot see a key that every locale is missing, so a new test pins every key the helper can return, and its placeholders, in both namespaces for every locale.

Per-input validation (web + mobile)

  • Current password required. New password: "Enter a new password", then the policy as sentences ("Must contain an uppercase letter (A-Z)"). The confirmation is judged once a new password exists.
  • Errors appear on the first submit, under their own input (aria-invalid, focus moves to the first one), and are re-checked as the user types.
  • From the server, a wrong or missing current password shows under that input until it is edited, and too short shows under the new password. Network, SSO and unknown errors stay in the banner.
  • Web: pure validatePasswordChange + passwordChangeErrorField in lib/auth/password-change-form.ts; 5 new settings.security keys in all 7 locales, worded as mobile already ships them.
  • Mobile: same rules with Form validators (settings/utils/password_change_form.dart) and changePasswordErrorField. No new ARB keys.
  • Not changed: ChangePasswordDialog on both platforms, which nothing renders.

Confirmation after a success (web + mobile)

  • After a change, the page used to clear the form and show a 4-second toast at the top of the screen. Once the toast faded, the page looked unchanged.
  • The card now keeps a confirmation until an input is edited or Cancel is pressed: "Password changed successfully" + "Your other devices have been signed out.", or, for a first password, "You can now also sign in with your email and this password."
  • Web renders it as role="status"; mobile renders it as a live-region PasswordChangedNotice. The toast and the top banner are removed.
  • New keys in all 7 locales (web changeDoneBody / setDoneBody, mobile securityChangeDoneBody / securitySetDoneBody).
  • Checked on dev in the browser with a seeded test account: changed its password, then changed it back.

Verified:

  • tsc, eslint and flutter analyze are clean.
  • New tests: vitest 65/65 (helper, catalogue, page behaviour) and Flutter test/features/settings 33/33.
  • Full web vitest: 1012/1019. The 7 failures are all 5 s timeouts under full-suite load on Windows, and those files pass 117/117 when run alone.
  • Merged into dev as 8364d917 and 92290ba4, and tested manually there.

Testcontainers fix (#178) is merged into main, and this branch now includes it.

🤖 Generated with Claude Code

nguyenhoangdung245 and others added 2 commits October 28, 2026 23:24
…word change

Changing the password with a wrong current password threw next-intl
MISSING_MESSAGE (settings.security.incorrectCurrent) in dev and rendered the
raw key in production. 732eb32 dropped incorrectCurrent and currentRequired
from settings.security and settings.changePasswordDialog in every locale;
3e993af then added passwordChangeErrorKey, which still returns both.

- Re-add both keys to both namespaces in all 7 locales, with the wording
  they had before 732eb32.
- New test drives every branch of passwordChangeErrorKey and asserts each
  returned key (and its placeholders) exists in both namespaces in every
  locale; the parity test cannot catch a key missing from all locales alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Submitting Settings -> Security with only the current password filled showed
the strength checklist's "≥8 characters" chip in a banner above the form; an
empty current password was never checked before the request.

- Validation is per input: current password required, new password required
  then the policy as sentences ("Must contain an uppercase letter (A-Z)"),
  confirmation judged once a new password exists. Errors appear on the first
  submit and are re-checked as the user types.
- A wrong / missing current password from the server shows under that input
  (and takes focus) until it is edited; too short goes under the new
  password. Network / SSO / unknown stay in the banner.
- Web: pure `validatePasswordChange` + `passwordChangeErrorField`
  (lib/auth/password-change-form.ts); new settings.security keys in all 7
  locales, worded as mobile already ships them.
- Mobile: same rules with Form validators
  (settings/utils/password_change_form.dart) and `changePasswordErrorField`.
- Tests: vitest (helper, catalogue keys, page behaviour) and a Flutter widget
  test mirroring it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
platform-web Ready Ready Preview Oct 28, 2026 5:41pm UTC

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a27b4bb2-0c43-4560-8a8c-54e7815b6081
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…fading toast

After a successful change the Security page cleared the form and showed a
4-second toast at the top of the screen; once it faded the page looked exactly
as before, so it was unclear whether anything happened, and nothing said the
other devices had just been signed out.

- The card now shows a lasting confirmation ("Password changed successfully"
  + "Your other devices have been signed out.", or for a first password "You
  can now also sign in with your email and this password.") until an input
  is edited or Cancel is pressed. Web renders it as role="status"; mobile as
  a live-region PasswordChangedNotice. The toast / top banner is gone.
- New keys in all 7 locales: web settings.security.changeDoneBody /
  setDoneBody, mobile securityChangeDoneBody / securitySetDoneBody
  (gen-l10n regenerated).
- Tests: vitest page test + catalogue check, Flutter widget test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MITOM06
MITOM06 merged commit e897bb1 into main Nov 1, 2026
12 checks passed
@MITOM06
MITOM06 deleted the fix/web-password-change-messages branch November 6, 2026 13:55

This branch was successfully deployed

1 active deployment
Preview — f0200bd2 Deployed Oct 28, 2026 by vercel[bot]
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.

2 participants