Skip to content

fix(settings): tell an SSO account its password lives at the identity provider (#850) - #852

Merged
alex-dembele merged 1 commit into
masterfrom
850-bugsettings-an-sso-account-is-offered-a-change-password-form-it-cannot-use
Oct 2, 2026
Merged

alex-dembele merged 1 commit into
masterfrom
850-bugsettings-an-sso-account-is-offered-a-change-password-form-it-cannot-use

Conversation

@alex-dembele

Copy link
Copy Markdown
Member

Closes #850

An account that signs in through an identity provider has no password in OpenRisk. The Change password card used to show it three fields that could only fail: it found out after submitting, from a 409 no_local_password. The card now reads has_password from /auth/me before rendering anything.

Stacked on #848 (base: 754-…), because has_password comes from there. Once #848 is merged, GitHub retargets this PR to master.

Behaviour

/auth/me Card
loading skeleton, no form
has_password: false the existing message accountSecurity.managedByIdp (FR/EN); no fields, no button, no show/hide toggle
has_password: true the form, unchanged
read failed the form as before; the server's 409 still switches it to the message

Changes: useHasLocalPassword() (new hook), and fetchHasLocalPassword() in authService.ts, which fetchDisableMFAProof from #754 now reuses. No new i18n key, so FR/EN parity is untouched.

Verification

$ npx vitest run src/features/auth/__tests__/changePasswordCard.test.tsx     (3 consecutive runs)
      Tests  7 passed (7)      ← 4 existing + 3 new (#850)
$ npx tsc --noEmit -p .    → OK
$ npx eslint <touched files>   → OK
$ npx vitest run src/features/auth src/features/settings src/shared
      Tests  384 passed (384)   ← 7 of 8 runs; see "Not done"

Live (branch server on PostgreSQL 16 with a fresh database, real React app on Vite, Chromium):

  • Password account: the card shows its 3 password fields; no message.
  • Same session after users.password = '': the card shows "Ce compte se connecte via votre fournisseur d'identité : son mot de passe se change chez lui."; 0 fields, 0 buttons, 0 requests to /auth/password/change.
  • Dark theme: text #b5b2aa on build: restore green tree (build/vet/lint) + CI gate #111, about 9:1. Screenshots: .playwright-mcp/850-sso-card-light.png, 850-sso-card-dark.png.

Not done

  • One run of the auth + settings + shared suites had 2 failures whose names I didn't capture. The next 7 runs (including 2 under tsc load) were all green, and the 7 card tests passed 3 times out of 3. It looks like a pre-existing timing flake, but I couldn't reproduce or name it.

🤖 Generated with Claude Code

… provider (#850)

The Change password card offered its three fields to an account with no
password in OpenRisk, which only learned so after submitting (409
no_local_password). The card now reads has_password from /auth/me and shows the
existing managed-by-IdP message up front, a skeleton while it finds out, and the
old form plus the server's correction when it cannot tell.

Signed-off-by: alex-dembele <alexandredembele16@gmail.com>
Base automatically changed from 754-securityauth-disabling-mfa-does-not-re-verify-the-password to master October 1, 2026 12:21
@alex-dembele alex-dembele self-assigned this Oct 2, 2026
@alex-dembele alex-dembele reopened this Oct 2, 2026
@alex-dembele
alex-dembele merged commit 6ff36f9 into master Oct 2, 2026
14 of 26 checks passed
@alex-dembele
alex-dembele deleted the 850-bugsettings-an-sso-account-is-offered-a-change-password-form-it-cannot-use branch October 2, 2026 12:33
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.

bug(settings): an SSO account is offered a Change password form it cannot use

1 participant