Skip to content

Improvement: Change-password flow — in-form validation, reauth warning, and global sign-out #1945

Closed

Description

@yannickmonney

Problem

(a) A wrong current password only fails on submit via a toast, instead of being validated within the form like the 2FA enable flow. (b) There is no warning that changing the password requires re-authentication, and it must be guaranteed that the user is signed out of all devices.

Current behavior

  • ChangePasswordDialog, services/platform/app/features/settings/account/components/account-form.tsx:255-403: current password is only min(1) validated (:268-270); a wrong password is surfaced as a destructive toast on submit (:319-324). After success it signs out and hard-navigates locally (:326-341) — a comment claims sessions are "revoked/rotated server-side".
  • 2FA enable passes the password to authClient.twoFactor.enable({ password }) and validates it as part of the flow (two-factor-section.tsx:65-86).

Proposed change

  1. Validate the current password in the form (inline field error — same pattern the 2FA flow uses) rather than a post-submit toast.
  2. Add a clear warning in the dialog that changing the password will sign the user out everywhere and require re-authentication.
  3. Verify and ensure the backend revokes all sessions on password change (check convex api.users.mutations.updateUserPassword + Better Auth session handling); add a backend test asserting other sessions are invalidated.

Acceptance criteria

  • A wrong current password shows an inline field error, no generic toast.
  • The dialog warns about global sign-out / reauth before submit.
  • After a password change, sessions on other devices are invalidated (test-backed).

Ripple

Locale strings for the warning; backend session-revocation test.

Merges the two change-password observations from the original backlog.

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions