Skip to content

fix(auth): a cloud-managed runtime's password refusal is shown in the session's language - #37965

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-34171-login-managed-refusal-copy
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-34171-login-managed-refusal-copy

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #34171

Clause-②: yes (widening) — @object-ui/auth ForgotPasswordFormProps gains the optional errorMessages; @object-ui/i18n gains auth.login.errors.managedPasswordSignIn and auth.login.errors.managedPasswordReset in every locale
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:托管环境里有人用密码登录、找回、重置或设置密码时,页面不再显示英文的“请求失败 409”,而是用当前语言说明本环境通过身份提供方登录,并指向那个登录按钮;自建部署的登录不变,只有单点登录专用模式下找回或设置密码被拒时也改为同一句本地化说明。
  • 为什么做:属于托管环境登录体验收尾,替托管环境的用户解决“中文页面冒出看不懂的英文报错”。
  • 出错会怎样:最坏是这几个页面在托管环境回到原来的英文状态行,其他报错照旧显示服务端原文;改动可直接撤回。
  • 要你做什么:无。

What changes

On origin/main, a cloud-managed runtime refuses the password doors with 409 RESOURCE_CONFLICT, and the code never reached the pages. The hosted relay (auth-proxy-plugin.ts, every password door) and plugin-auth's set-initial-password route (cloudManagedRefusal) answer in the ADR-0112 envelope, { success: false, error: { code, message } }. better-fetch spreads that body, so its code and message arrive nested under error.error, and toAuthError read only the top level. plugin-auth's reset doors throw better-auth's APIError from the before hook, a flat body with the code. There the code was dropped by the call site: forgotPassword and resetPassword threw a bare new Error(message). So sign-in, forgot, reset and set-password showed the server's English sentence or Auth request failed with status 409, whatever the language, and no host map could localize a code that never arrived. The fix is on the producer side of the client boundary first, then the localized copy.

  • ui/packages/auth/src/createAuthClient.ts, the toAuthError hunk: code, message, details and userMessage are read from the flat body first and from the envelope's error only when the flat body has none. A better-auth refusal answers exactly as before. The same file already reads both shapes in acceptInvitationOneStep (body.code ?? body.error.code). forgotPassword, resetPassword and setInitialPassword now throw through toAuthError, so they keep the code and status. Their message fallbacks are unchanged. The updateUser hunk and types.ts (open PR fix(auth)!: createAuthClient().updateUser declares a void result, matching better-auth's receipt #37433) are untouched, and the two PRs merge in either order.
  • ui/packages/auth: ForgotPasswordForm gains errorMessages, the same code-to-text map LoginForm takes. The lookup LoginForm used is moved, unchanged, to refusal-text.ts and shared.
  • ui/packages/app-shell: signInRefusalMessages maps RESOURCE_CONFLICT to auth.login.errors.managedPasswordSignIn, which says the deployment signs you in through its identity provider and points at the button above. The new exported passwordDoorRefusalMessages maps it to auth.login.errors.managedPasswordReset for the forgot, reset and set-password doors. Three plugin-auth producers answer that code there, and the map's comment names them: cloud-managed.ts, and two that a self-hosted deployment answers too. sso-only-local-password.ts refuses an account the identity provider provisions while SSO-only mode is on, and pending-sso-marker.ts refuses a pending SSO person. The sentence (you sign in through the identity provider, and no password is set or reset here) is true for all three readers, so the mapping stands for them. It is kept separate on purpose, because the sign-in map's two-factor sentences (INVALID_CODE, and so on) would be wrong on a reset door. The package's forgot-password page passes it.
  • ui/apps/console: the forgot-password page passes the map, and the reset-password and set-password pages map the toast's description through it.
  • ui/packages/i18n: two keys in every locale (the key-parity test requires all eleven). The zh-Hant entries come from gen:zh-hant.

Read first (by risk):

  1. ui/packages/auth/src/createAuthClient.ts, the toAuthError hunk: the read order (flat first, envelope second) is what keeps every better-auth refusal unchanged.
  2. ui/packages/auth/src/createAuthClient.ts, the setInitialPassword hunk: it now throws through toAuthError with its old status-line fallback, so it also carries code and status.
  3. ui/packages/app-shell/src/console/auth/signInRefusalMessages.ts: the two maps and why they are separate.

Tests

  • New ui/packages/auth/src/__tests__/managedRefusalEnvelope-34171.test.ts. It drives the real client over a mocked fetch. Each of the four doors rejects with code RESOURCE_CONFLICT, status 409 and the envelope's message, and details and userMessage survive. Three controls: the flat better-auth body answers as before, the flat body wins when both name a code, and an empty body keeps the status line with no code.
  • ui/packages/app-shell/src/console/auth/__tests__/loginRefusalCodes-11058.test.tsx, new top-level describe. It renders the published login page over a real client in zh. The envelope 409 shows the zh managedPasswordSignIn, and neither the server sentence nor the status line appears. CONTROL: another code in the envelope shows its own server message.
  • New ui/packages/app-shell/src/console/auth/__tests__/passwordDoorRefusal-34171.test.tsx. The forgot-password page, end to end in zh, shows the localized reset sentence. CONTROL: an unmapped refusal keeps its message. A map-shape pin checks that the reset map carries no sign-in sentence.
  • ui/packages/auth/src/__tests__/forgot-password-success-message.test.tsx, new describe: ForgotPasswordForm maps by code. Two controls: an unmapped code, and no map at all.
  • New ui/apps/console/src/pages/auth/__tests__/passwordDoorRefusal-34171.test.tsx: the reset-password and set-password pages show the localized sentence. CONTROL: another code keeps its server message. A further describe pins the self-hosted SSO-only refusal (plugin-auth's own SSO_ONLY_REFUSAL_MESSAGES text) on both pages: it shows the same mapped sentence.

Reverse validation (one-off, no test file kept): scripts/ablation-replace.mjs replaced the envelope read with an empty object (anchor 1 to 0, blob d7821627 to f40658a6). The envelope pins and the app-shell end-to-end pins went red: Tests 8 failed | 18 passed (26). Restored: blob equals HEAD (d7821627) and git diff HEAD is empty. These tests import from source, so no dist/ was in the path.

Acceptance notes

  • On the sign-in door only a cloud-managed runtime answers RESOURCE_CONFLICT, so a self-hosted sign-in is unchanged. On the reset and set-password doors, a self-hosted deployment in SSO-only mode, or a pending SSO person, now sees the localized sentence in place of plugin-auth's English one. That is deliberate (contract review 7219466980, S2): the sentence is true for that reader.
  • The phone reset doors (postPhoneNumberEndpoint) still read only the flat body. The hosted relay notes that the phone-number plugin is not mounted on a hosted runtime, so no managed refusal reaches them. Left as is.
  • The set-password page's copy is the reset sentence ("no password is set or reset here"), which fits a signed-in person who came in through single sign-on.
  • The claim was revised in 7218058235 to cover createAuthClient.ts (toAuthError hunk), app-shell, i18n and the console pages. Routing forgotPassword, resetPassword and setInitialPassword through toAuthError is three call-site lines outside that hunk. They are needed for the reset doors to carry the code, and they do not touch the updateUser hunk.

Verification

Two-minute check: cd ui && pnpm exec vitest run packages/app-shell/src/console/auth/__tests__/loginRefusalCodes-11058.test.tsx. Expect all tests green, including a cloud-managed password refusal is localized.

Rework round (head e28f645)
  • Changes: the declaration is now Clause-②: yes (widening) (S1). The changeset and this body correct the self-hosted claim and the mechanism sentence (S2, N3). The passwordDoorRefusalMessages comment names the three producers. A new SSO-only pin was added. No runtime code changed.
  • vitest run of the five touched test files: Test Files 4 passed, Tests 41 passed. The console file then failed to load until @objectstack/client was built. After that build, the console file alone: Test Files 1 passed (1), Tests 6 passed (6), VERDICT command-exit 0.
Package tests, type-check and build (head fe59df0)
  • Closure build: pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' --filter '@object-ui/console^...' build, VERDICT command-exit 0.
  • pnpm --workspace-concurrency=2 --filter @object-ui/auth --filter @object-ui/i18n --filter @object-ui/app-shell --filter @object-ui/console type-check, VERDICT command-exit 0 (auth, i18n and app-shell include their test tsconfig; console includes src).
  • vitest run packages/auth/ packages/i18n/ packages/app-shell/src/console/auth/: the first run was red only on zh-hant-generated (zh-Hant was hand-written), fixed by regenerating. Then packages/i18n/: Test Files 107 passed (107), Tests 1867 passed | 13 skipped.
  • pnpm --filter @object-ui/console test: Test Files 339 passed (339), Tests 3711 passed (3711), VERDICT command-exit 0.
  • app-shell (2428 test files) was narrowed locally to src/console/auth/. The full suite is CI's.
Derived gate families (dispatch-gates --commands, 42)
  • 41 of 42 exited 0. pnpm --dir ui exec vitest run scripts/ was SIGKILLed for memory on its first run, while the console suite ran beside it. Rerun alone, it exited 0: Test Files 172 passed | 2 skipped (174).
  • dispatch-gates --ran: 42 derived, 42 run, 0 NOT-MEASURED, 0 UNRUN.

Generated by Claude Code

toAuthError reads code, message, details and userMessage from the ADR-0112
envelope when better-auth's flat body has none, and forgotPassword,
resetPassword and setInitialPassword now go through it. The sign-in refusal
map and a new password-door map turn 409 RESOURCE_CONFLICT into a localized
sentence that points at the identity provider's button.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: fe59df0bce3265232f9864cf8efa4e648453f554
Local-runs: none
Scope: ui/packages/auth/src/createAuthClient.ts, ui/packages/auth/src/refusal-text.ts, ui/packages/auth/src/LoginForm.tsx, ui/packages/auth/src/ForgotPasswordForm.tsx, ui/packages/app-shell/src/console/auth/signInRefusalMessages.ts, ui/packages/app-shell/src/console/auth/ForgotPasswordPage.tsx, ui/packages/app-shell/src/index.ts, ui/apps/console/src/pages/auth/ForgotPasswordPage.tsx, ui/apps/console/src/pages/auth/ResetPasswordPage.tsx, ui/apps/console/src/pages/auth/SetPasswordPage.tsx, ui/packages/i18n/src/locales/{ar,de,en,es,fr,ja,ko,pt-BR,ru,zh-Hans,zh-Hant}.ts, ui/packages/auth/src/tests/managedRefusalEnvelope-34171.test.ts, ui/packages/auth/src/tests/forgot-password-success-message.test.tsx, ui/packages/app-shell/src/console/auth/tests/loginRefusalCodes-11058.test.tsx, ui/packages/app-shell/src/console/auth/tests/passwordDoorRefusal-34171.test.tsx, ui/apps/console/src/pages/auth/tests/passwordDoorRefusal-34171.test.tsx + read, not reviewed: .changeset/34171-managed-password-refusal-copy.md
Security-touching: no
Rule-change-verified: none
Regen-provenance: none

First record on this head. Inputs: card #34171, claim 7217934544, claim revision 7218058235, dev reports 7218033222 and 7219295017, the PR body, git diff origin/main...fe59df0b (merge-base 43ce7311), and the check-runs on this head. Read outside the diff, not reviewed: plugin-auth cloud-managed.ts, sso-only-local-password.ts, pending-sso-marker.ts, auth-manager-before-hook.ts, auth-plugin.ts (the set-initial-password route), and cloud packages/objectos-runtime/src/hosted-local-password.ts. Nothing was built or run.

The committed tree touches no published schema (packages/spec/src/**) and no governed rule text, and the declaration reads Clause-②: no. As declared, the diff owes no L2. S1 below would change that.

① Derived judgments

  • toAuthError, flat first. A better-auth flat refusal is unchanged.
    • message: error.message ?? envelope.message ?? fallback ?? status line. A flat message still wins.
    • code: error.code || envelope.code. A flat code still wins.
    • userMessage and details: flat ?? envelope, then the same string and plain-object guards as before.
    • status and dependents are read from the flat body only, as before.
    • The one changed order: an envelope message now comes before a caller's fallbackMessage. This reaches all 24 callers, not only the four doors. An organization call that got an ADR-0112 envelope used to show its fallback ("Failed to list organizations") and now shows the envelope's message and code. That is the direction fix(spec): let a schemaless node own an expression-ledger entry (#4439) #4474 set, and no consumer reads those fallback strings.
  • The envelope read is safe on a non-object body. isPlainObject(error.error) refuses a string ({ error: "invalid_grant" }), an array and null. Only strings are taken for message and code. setInitialPassword accepts the parsed body only when it is a plain object, and its status is written after the spread, so a body's own status cannot replace the HTTP one.
  • No caller reads the old message text. Auth request failed with status and Set password failed with status occur only in createAuthClient.ts and the new test. AuthProvider rethrows the same error object for all three doors, so the code reaches the pages.
    • forgotPassword and resetPassword: the message is the same for a flat body. code, status, details and userMessage are new on the error.
    • setInitialPassword: it used to read body.error.message only. A flat { message } body now shows its message, where it showed the status line. The route answers the envelope in every arm, so no real answer changes.
  • The two maps are kept apart correctly.
    • signInRefusalMessages gains RESOURCE_CONFLICT. It is passed to LoginForm (two sites: the submit and the phone code send) and to the console's dev-admin row. On those doors only the hosted relay answers this code: plugin-auth refuses no sign-in door with it. A pending person's session is refused with PERMISSION_DENIED.
    • passwordDoorRefusalMessages holds one key. It is passed to both forgot-password pages and read by the reset-password and set-password pages. No two-factor sentence can reach a reset door. The map-shape pin holds this.
  • One code, three producers on the reset and set-password doors. See S2. Besides the cloud-managed refusal, plugin-auth answers 409 RESOURCE_CONFLICT on reset-password, phone-number/reset-password and set-initial-password for an IdP-provisioned user in SSO-only mode and for a pending SSO person. SSO-only mode is a self-hosted setting.
  • i18n parity: holds. Both keys are in all eleven locale files. zh-Hant matches the generator's output style, and the dev report names the regeneration.
  • Clause-②: no: WRONG, see S1. @object-ui/app-shell is private: true, so its new index.ts export is not a published surface and does not change the answer by itself. @object-ui/auth is published, and ForgotPasswordFormProps, exported from its . entry, gains the optional errorMessages. @object-ui/i18n gains two keys in every locale it ships.
  • Metadata-protocol: none: RIGHT. Nothing a metadata author can write changes.

② Semver level

  • patch on @object-ui/auth, @object-ui/app-shell, @object-ui/i18n and @object-ui/console: right. Under Metadata-protocol: none a non-protocol change ships patch, widening or not (AGENTS.md Post-Task step 3). The level stays patch after S1.
  • No BREAKING banner is owed: nothing is removed or renamed. refusalText moved between two unexported modules.
  • The changeset and the PR body carry the same two declaration lines.

③ Boundary flags

  • Author: objectstack-fleet[bot]. No relay note is owed.
  • File surface against claim revision 7218058235. Outside it: LoginForm.tsx (the lookup moved out), the new refusal-text.ts, app-shell index.ts, the console ForgotPasswordPage.tsx, seven more locale files (the revision names four; the parity test needs eleven), and the three call sites in createAuthClient.ts beyond the toAuthError hunk. The PR body admits the call sites and the locales. The rest is the seat's scope line to write.
  • fix(auth)!: createAuthClient().updateUser declares a void result, matching better-auth's receipt #37433: this diff does not touch updateUser or types.ts.
  • Security: no enforcement changes. The forgot-password sentence is the same for every request on a managed runtime, so it says nothing about any account.
  • SQL push-down: nothing in the diff. Nothing to report.
  • Main: the head merges without conflict (merge-tree, no checkout).
  • The PR is a draft. No auto-merge is armed.
  • Check-runs on this head, read at 2026-11-27T13:23:50Z: 56 runs, 20 success, 13 skipped, 23 in progress, none failed.
    • Success so far: Check Changeset, PR-body guards, Governed Surface Queue Guard, Check PR Size, Lint · ESLint, the Type Check families (workspace, source, debt ledger, consumer), TypeScript Type Check, Test Core, Build UI Deps, Dogfood Regression Gate, Live E2E UI.
    • Not yet answered: Test UI 1/16 to 16/16, Lint UI, Type Check UI, Build & E2E UI, and four Lint families (PM dispatch-gates, docs & code guards, repo & tooling, slot lookup & corpus).
    • "All green" is not established on this head.

Findings

S1 (should-fix): the declaration should read Clause-②: yes (widening), in the changeset, the PR body and the seat's note against the claim.

  • @object-ui/auth is published, and its . entry exports ForgotPasswordFormProps, which gains the optional errorMessages. @object-ui/i18n gains two keys in every shipped locale.
  • Same-kind changes declared yes (widening) on main: 36290 (optional props and locale keys), 36372, 36374, 35955, 36899, 36070.
  • A minority declared no for an optional prop (36219, 36459, 36849, 37858). The reading here follows the majority and record 7211486008.
  • Effect: the level stays patch. A yes makes the PR owe L2 by declaration.

S2 (should-fix): the changeset's last paragraph, "Self-hosted deployments never answer this refusal on these doors, so nothing changes there", is not true for the reset and set-password doors.

  • sso-only-local-password.ts answers 409 RESOURCE_CONFLICT on set-initial-password, reset-password and phone-number/reset-password for an IdP-provisioned user when SSO-only mode is on. pending-sso-marker.ts answers it for a pending person in every mode.
  • With this diff those pages show the mapped sentence in place of the server's own ("This environment is in SSO-only mode and your account is provisioned by your identity provider ...").
  • The mapped sentence is still true for that reader, and it is now localized. So the code can stand.
  • Owed: correct that paragraph and the same claim in the PR body, and name the two other producers in the passwordDoorRefusalMessages comment. A pin on one of them would hold the decision.
  • The card's own Expected line carries the same premise. The seat records the deviation.

N1 (nit): a refusal whose message is the empty string now reaches the page as an empty description on setInitialPassword, where the old code fell back to the status line. No producer sends one.

N2 (nit, a card): the profile page's password card (ProfilePage.tsx, PasswordCard) draws err.message raw for setInitialPassword and changePassword. The relay refuses change-password too, so on a hosted runtime that card still shows the server's English sentence. Four client methods also still throw new Error(error.message ?? ...) without toAuthError (sendVerificationEmail, signOut, updateUser and the social sign-in). Out of this card's scope.

N3 (nit): the PR body says plugin-auth cloudManagedRefusal answers the envelope on the reset doors. Those doors throw better-auth's APIError in the before hook, a flat body with the code. cloudManagedRefusal is the set-initial-password route's. On main the code was dropped there by the call site, not by toAuthError. The fix covers both shapes.

N4 (nit): the reset-password page, the set-password page and the dev-admin row look the code up inline and skip the CODE:cause key that refusalText tries first.

N5 (nit, accepted): postPhoneNumberEndpoint still reads the flat body only. The PR's acceptance note covers it.

No must-fix. S1 and S2 are fixes to prose faces and one comment.

Implemented-by: claude/issue-34171-login-managed-refusal-copy
Reviewed-by: session_01Q4EjjQkY5yXZrN9BEA3rEK

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e28f6454095044252e53d347e8046a1f1d23d5fd
Local-runs: none
Scope: ui/packages/app-shell/src/console/auth/signInRefusalMessages.ts, ui/apps/console/src/pages/auth/tests/passwordDoorRefusal-34171.test.tsx + read, not reviewed: .changeset/34171-managed-password-refusal-copy.md
Security-touching: no
Rule-change-verified: none
Regen-provenance: fe59df0bce3265232f9864cf8efa4e648453f554 to e28f6454095044252e53d347e8046a1f1d23d5fd is one commit. It changes the changeset (a prose face), one doc comment in signInRefusalMessages.ts and one added test describe. No runtime line moved. Every other path on record 7219466980's Scope line is byte-identical, and that record's code judgments are carried here unchanged.

Delta round by the reviewer of record 7219466980 (PASS at fe59df0b, S1 and S2 open). Inputs: git diff fe59df0b e28f6454, the current PR body, dev report 7219716101, and the check-runs on this head. Nothing was built or run.

Tier owed: with Clause-②: yes (widening) now declared, the PR owes L2 by declaration alone, which is TIER_DEFAULT. The diff still touches no published schema and no governed rule text, so CONTRACT_REVIEW_TIER is not owed by any face. The Served-tier line above is the placeholder the seat fills.

① Derived judgments

  • The delta: three files, 48 lines added and 7 removed. No file under ui/packages/auth, no locale file and no page moved.
  • Clause-②: yes (widening): RIGHT. The changeset line and the PR body line are the same text. Both name the two published additions: the optional errorMessages on @object-ui/auth ForgotPasswordFormProps, and the two @object-ui/i18n keys in every locale.
  • Metadata-protocol: none: RIGHT, unchanged.
  • The passwordDoorRefusalMessages comment now names the three plugin-auth producers of 409 RESOURCE_CONFLICT on these doors: cloud-managed.ts, sso-only-local-password.ts and pending-sso-marker.ts. This matches the server code read for the first record.
  • The new describe pins the SSO-only refusal on the reset-password and set-password pages. Its two English sentences are plugin-auth's SSO_ONLY_REFUSAL_MESSAGES.resetPassword and .setInitialPassword, word for word. Both pages show the zh managedPasswordReset.

② Semver level

  • patch on the four packages: right, unchanged. yes (widening) beside Metadata-protocol: none ships patch (AGENTS.md Post-Task step 3). Check Changeset is success on this head.
  • No (narrowing) arm and no kind other than none, so no Skills-docs: line is owed.

③ Boundary flags

  • The seat's note of the declaration change against claim 7217934544, whose line reads Clause-②: no, was not on the card when this was read (13:50Z). It is bookkeeping on the claim, not a condition on the diff.
  • The card's Expected line still says self-hosted deployments never answer this refusal. The PR's acceptance note records the deviation and cites record 7219466980. The seat's ACCEPT names it.
  • The file-surface note from the first record is still the seat's scope line to write.
  • The PR body now ends with a signed: HTML-comment trailer. The dev report says the relay required it.
  • SQL push-down: nothing in the delta. Nothing to report.
  • Main: the head merges without conflict against 0b539b6a (merge-tree, no checkout). mergeable_state reads clean.
  • The PR is a draft. No auto-merge is armed.
  • Check-runs on this head, read at 2026-11-27T13:50:11Z: 62 runs, 47 success, 15 skipped, none failed, none cancelled, none in progress.
    • Test UI 1/16 to 16/16, Lint UI, Type Check UI, Build & E2E UI and Check Changeset all answered success.
    • Every check on this head is green.

Findings

Findings of record 7219466980, at this head:

S1 (should-fix): closed.

  • The changeset and the PR body both read Clause-②: yes (widening) with the two additions named. The seat's note against the claim is recorded as owed in ③.

S2 (should-fix): closed.

  • The changeset's last paragraph now says a self-hosted sign-in is unchanged, and that the reset and set-password doors show the localized sentence in the SSO-only and pending-SSO cases.
  • The PR body says the same in its maintainer brief, its What changes section and its acceptance notes.
  • The map's comment names the producers, and a pin holds the decision for the SSO-only case.

Nits, none with an effect on correctness or the contract:

  • N1 (open, accepted). An empty-string refusal message on setInitialPassword reaches the page as an empty description.
  • N2 (open, a card). The profile page's password card draws err.message raw, and four client methods still throw without toAuthError.
  • N3: closed. The changeset and the PR body now say the reset doors throw a flat APIError whose code the call site dropped, and that the envelope comes from the relay and the set-initial-password route.
  • N4 (open). The reset-password page, the set-password page and the dev-admin row skip the CODE:cause key.
  • N5 (open, accepted). postPhoneNumberEndpoint reads the flat body only.
  • N6 (new). The comment's SSO-only bullet lists reset-password and set-initial-password and leaves out phone-number/reset-password, which the same module also refuses.

No must-fix, no should-fix.

Implemented-by: claude/issue-34171-login-managed-refusal-copy
Reviewed-by: session_01Q4EjjQkY5yXZrN9BEA3rEK

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

维护者速读

  • 托管环境里用密码登录、找回、重置或设置密码被拒时,页面不再显示英文的「请求失败 409」,而是用当前语言说明本环境通过身份提供方登录,并指向那个按钮。
  • 根因在前端认证客户端:服务端的错误码嵌在一层里,客户端只读外层,错误码一直丢失;先修客户端,再加本地化文案。
  • 自建部署的登录不变;自建开了「仅单点登录」时,重置/设置密码页也会显示这句本地化提示(对那类用户同样成立)。
  • 要你做什么:无,本席直接落地。

席位核对 — ACCEPT · repo:objectstack#6 · head e28f6454095044252e53d347e8046a1f1d23d5fd

  • Shape: draft → main, Fixes #34171.
  • Premise measured (dev report 7218033222): the card's mechanism was wrong. The code was dropped at the client (toAuthError read only the flat body; three doors bypassed it), so the page drew Auth request failed with status 409, not the server sentence. Claim revised 7218058235 (option A: producer-side read first, then the copy).
  • Declaration change against claim 7217934544: the claim said Clause-②: no; the PR declares Clause-②: yes (widening) (published @object-ui/auth ForgotPasswordFormProps.errorMessages, two @object-ui/i18n keys). Level patch. Metadata-protocol: none unchanged.
  • Deviation from the card's Expected line: self-hosted reset / set-password also answer this refusal (SSO-only, pending SSO); those readers now see the same localized sentence, pinned. Recorded in the PR's acceptance note.
  • Scope admitted beyond revision 7218058235's surface: LoginForm.tsx (lookup moved unchanged into the new refusal-text.ts), app-shell index.ts export (private package), console ForgotPasswordPage.tsx, seven more locale files (key parity), three createAuthClient.ts call sites. updateUser and types.ts (fix(auth)!: createAuthClient().updateUser declares a void result, matching better-auth's receipt #37433) untouched.
  • Review history: contract review PASS 7219466980 (S1, S2 open) → rework → PASS 7220035689, no must-fix or should-fix open.
  • Gates: check-runs at head 47 success, 15 skipped, 0 failed (read by the reviewer 13:50Z).
  • Follow-ups: Profile page password card draws the server's English refusal for set-password and change-password #37973 (profile password card and remaining toAuthError callers, N2). N1, N4, N5, N6 left as nits.
  • Landing: widening, not narrowing — --land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Landing: seat ACCEPT 7220076480 and contract review PASS 7220035689 at head e28f6454095044252e53d347e8046a1f1d23d5fd; check-runs 47 success, 15 skipped, 0 failed. Marking ready and arming auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 13:54
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 46011283514 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (3/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/rest-config-contract-live.dogfood.test.ts > [#26572] the default RestServerConfig on a booted showcase: crud, batch and metadata > metadata acceptance
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: expected '{"type":"object","name":"showcase_pro…' not to match /budget|"spent"/
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 7 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Queue ejection triage (run 46011283514): the failing test is packages/qa/dogfood/test/rest-config-contract-live.dogfood.test.ts (showcase metadata acceptance), a package this PR does not touch. Queue-flake anchor #37987 lists this PR as inherited from root #37966 (showcase form layout), which is now out of the queue. Re-queuing once at the same head e28f6454095044252e53d347e8046a1f1d23d5fd; records unchanged (seat ACCEPT 7220076480, contract review PASS 7220035689).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants