Repository navigation
fix(console): the profile password card shows a password refusal in the session's language - #38025
Conversation
…de; auth client keeps the code on three more doors Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK 维护者速读
席位核对 — ACCEPT · repo:objectstack#6 · head
|
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK Landing: seat ACCEPT at head |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46041993507 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK Queue ejection triage (run 46041993507): every failed job is the console build, |
Fixes #37973
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
PasswordCardin the console'sProfilePage.tsx): a rejected set-password or change-password now picks its text by the refusal'scodethrough the existingpasswordDoorRefusalMessagesmap (app-shell), the same lookup the set-password page makes. A 409RESOURCE_CONFLICT(cloud-managed runtime, SSO-only account, pending SSO person) draws the localized sentence; any other code, or none, keeps the server's message. The lookup is own-key only, so a code that happens to spell anObject.prototypemember never picks a function.@object-ui/authcreateAuthClient):sendVerificationEmail,signOutandsignInWithProvidernow reject throughtoAuthError, so the thrown error carriescodeandstatusfrom better-auth's flat body or from the ADR-0112 envelope. Themessageis unchanged.updateUserstays as it is: it is fenced by open draft PR fix(auth)!: createAuthClient().updateUser declares a void result, matching better-auth's receipt #37433, and the profile password card does not call it, so this PR closes the card. That method's switch totoAuthErrorbelongs to fix(auth)!: createAuthClient().updateUser declares a void result, matching better-auth's receipt #37433's hunk.@object-ui/authand@object-ui/console, patch.Tests
apps/console/src/pages/system/__tests__/ProfilePage.passwordRefusal-37973.test.tsx(new, 4 cases): renders the real page and the real map. Set-password and change-password withRESOURCE_CONFLICTdraw the localized sentence and read pack keyauth.login.errors.managedPasswordReset. CONTROL:INVALID_PASSWORDkeeps the server's message, and so does a rejection with no code.packages/auth/src/__tests__/managedRefusalEnvelope-34171.test.ts: a new top-leveldescribe(6 cases) drives the real client over a mockedfetchfor the three methods. An envelope refusal keepsRESOURCE_CONFLICT/ 409 / its message. CONTROL: a flat better-auth refusal keeps its own code and message.Readings at 2d52a41
All at head
2d52a41c, run fromui/under the shared verify lock.pnpm exec vitest run packages/auth/ apps/console/src/pages/system/__tests__/ apps/console/src/pages/auth/__tests__/passwordDoorRefusal-34171.test.tsx:Test Files 65 passed (65),Tests 655 passed (655), VERDICT command-exit 0.pnpm --filter @object-ui/auth type-check: exit 0.pnpm --filter @object-ui/console type-check: exit 0, after building the console's dependency closure.git restore --source, test files kept):Tests 8 failed | 10 passed (18). The 8 failures are the 6 new client cases and the 2 profileRESOURCE_CONFLICTcases. The 2 profile CONTROLs pass on the base, as they should. Restored withgit checkout HEAD, andgit diff HEADis empty afterwards.dispatch-gates.mjs --commands): 37 of 39 exit 0, includingpnpm --dir ui exec vitest run scripts/(Tests 5138 passed | 2 skipped).check:query-options-erasureandcheck:type-check-debtwere killed by a 300s local timeout on a shared box, so they are NOT MEASURED locally and CI runs both.Acceptance notes
maintoday the cloud-managed refusal closesset-initial-passwordand leaveschange-passwordopen (thecloud-managed.tsheader says changing a password is/change-password's, cloud#4471). The change-password mapping covers any producer that answers that code there, and the change-password test pins the card's behaviour, not a server door.Verification
Read first (by risk):
ui/packages/auth/src/createAuthClient.ts, thesignOuthunk: the rejection now carriescode/status. Itsmessageis byte-identical, andTokenStorage.clear()still runs before the throw.ui/apps/console/src/pages/system/ProfilePage.tsx, thePasswordCardcatch.Two-minute check: from
ui/, runpnpm exec vitest run apps/console/src/pages/system/__tests__/ProfilePage.passwordRefusal-37973.test.tsx. ExpectTests 4 passed (4).Generated by Claude Code