From dc1c8620bcaafab81d0ef5a61a6406d00219fe73 Mon Sep 17 00:00:00 2001 From: Cameron Waldron <1000178+CamW@users.noreply.github.com> Date: Fri, 31 Jul 2026 09:45:01 +0200 Subject: [PATCH] fix(login): provide hidden username on password set/change forms (#12490) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Which Problems Are Solved The set-password, change-password and set-register-password forms render only password fields — there is no username field inside the `
`. Password managers look for a username field adjacent to the password field in order to associate and save the credential. Without one, on these screens they either skip offering to save, or save a password entry with no username attached — so the saved record can't later be matched to the account. The existing sign-in form (`password-form.tsx`) already carries a username field for this reason; the password *creation/change* flows were missing the equivalent. # How the Problems Are Solved Add a username field to each of the three forms so the newly set password is saved against the correct account: - `set-password-form.tsx` and `change-password-form.tsx` use the `loginName`. - `set-register-password-form.tsx` uses the `email`. The field is a real, focusable-excluded `type="text"` input rather than `type="hidden"` — password managers ignore `type="hidden"` fields when looking for a username, so a visually-hidden text input is required. It is: - `readOnly` (avoids a controlled-input warning and user edits), - `tabIndex={-1}` and `aria-hidden="true"` (kept out of the tab order and the accessibility tree), - `className="sr-only"` (visually hidden but present in the DOM), - `autoComplete="username"` (tells the password manager what it is). The value comes from props already passed to each form, so no signatures change. # Additional Changes None. # Additional Context - The username values (`loginName` / `email`) are already available in each component, so this is a purely presentational change with no server-side or API impact. Co-authored-by: Max Peintner --- apps/login/src/components/change-password-form.tsx | 10 ++++++++++ apps/login/src/components/set-password-form.tsx | 10 ++++++++++ .../src/components/set-register-password-form.tsx | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/apps/login/src/components/change-password-form.tsx b/apps/login/src/components/change-password-form.tsx index e21fae43b..c352ebf7f 100644 --- a/apps/login/src/components/change-password-form.tsx +++ b/apps/login/src/components/change-password-form.tsx @@ -125,6 +125,16 @@ export function ChangePasswordForm({ passwordComplexitySettings, sessionId, logi {samlData && }
+
}
+ {codeRequired && (
diff --git a/apps/login/src/components/set-register-password-form.tsx b/apps/login/src/components/set-register-password-form.tsx index ce23f4d9a..d85806e74 100644 --- a/apps/login/src/components/set-register-password-form.tsx +++ b/apps/login/src/components/set-register-password-form.tsx @@ -102,6 +102,16 @@ export function SetRegisterPasswordForm({ {samlData && }
+