Repository navigation
fix(auth): the forgot-password page says a reset link can't be emailed on a deployment that sends no mail (#30366) - #30406
Merged
Conversation
…e deployment sends no mail (#30366) Read features.emailDelivery from /auth/config; on an explicit false the success screen says no reset link can be emailed here and to ask an administrator (Setup → Users). Absent key or failed fetch keeps today's text. The text names no address, so known and unknown addresses read the same. New labels in all ten locale packs, wired through both forgot-password pages. Claude-Session: https://claude.ai/code/session_01Utp6CYv3DdXJ81i2yQpGKm Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#3 · os-bill · session_01Utp6CbPN5UYMnBaNJPJWfG 维护者速读
席位核对 — ACCEPT · head 28a6cc3
|
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Bill · project thread
domain:ui#3 · os-bill · session_01Utp6CbPN5UYMnBaNJPJWfG
Fixes #30366
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
features.emailDelivery: false(没接邮件服务或只用 log 传输)时,提交后不再说「已发送重置链接」,改为「此处无法通过邮件发送重置链接,请联系管理员在 设置 → 用户 中为你设置新密码」,十种语言齐全。false才换文案;老服务端不带这个字段、或取配置失败,保持现在的文案。新文案不含地址、与提交结果无关,不会泄露账号是否存在。回滚即撤销本 PR。ui/packages/auth/src/ForgotPasswordForm.tsx(成功页分支)、ui/packages/auth/src/__tests__/forgot-password-success-message.test.tsx(新 describe 块)、ui/apps/console/src/pages/auth/ForgotPasswordPage.tsx(两行 label 传递)。pnpm --dir ui exec vitest run packages/auth/src/__tests__/forgot-password-success-message.test.tsx,预期 10/10 通过。What changes
ForgotPasswordFormreadsfeatures.emailDeliveryfrom the/auth/configanswer it already fetches (alongsidephoneNumberOtp). On an explicitfalsethe success screen showsnoDeliveryTitle/noDeliveryDescription— "A reset link can't be emailed here" / "This deployment doesn't send email, so no password reset link can reach you. Ask an administrator: they can set a new password for you from Setup → Users." — with an amber icon instead of the green one. The submit still goes to the server, so a log-transport deployment keeps writing the link to its console.ForgotPasswordFormLabelsgainsnoDeliveryTitleandnoDeliveryDescription;AuthPublicConfig.featuresgainsemailDelivery(the server half'sAuthFeaturesConfigSchema.emailDelivery).auth.forgotPassword.noDeliveryTitleandauth.forgotPassword.noDeliveryDescriptionin all ten locale packs, passed through by the Console's forgot-password page (label wiring only, per the claim's file-surface ruling) and byDefaultForgotPasswordPagein@object-ui/app-shell.@object-ui/auth,@object-ui/i18n,@object-ui/app-shell,@object-ui/console, allpatch(Metadata-protocol none).Why
On a deployment with no mail transport, every reset request ended on "Check your email — we've sent a password reset link to …", and nothing arrived. The server half (#30107, PR #30365) now says whether mail leaves the deployment; this is the page reading it.
An absent key keeps today's text. The spec text for the flag says absent means not live, but on the wire an absent key means a server older than the flag, and most of those do send mail; telling their users to find an administrator would be the larger harm. A failed config fetch is the same unknown. So only
emailDelivery === falseswaps the screen, and both unknowns are pinned to keep the "check your email" text.No account-existence oracle. The new text names no address and is chosen by the deployment flag alone, never by the reset request's answer (which is the same for known and unknown addresses server-side). A test submits a known and an unknown address on a no-mail deployment and asserts the two screens are byte-identical and carry no address.
Tests
forgot-password-success-message.test.tsx— new top-level describe (objectstack#30366) in the existing harness file: no-mail screen text and no address; known vs unknown address read identically; caller-supplied labels used;emailDelivery: true, absent key, and failed fetch each keep the old screen.Local runs (head 74302c6 after merging origin/main; the merge brought no ui/ paths)
pnpm --dir ui exec vitest run packages/auth/src/__tests__/forgot-password-success-message.test.tsx …/identifier-trim.test.tsx …/phoneTouchTargets-29080.test.tsx— Test Files 3 passed, Tests 14 passed.pnpm --dir ui exec vitest run packages/i18n/— Test Files 95 passed, Tests 1443 passed / 13 skipped (key parity included).pnpm exec turbo run type-check --filter=@object-ui/auth --filter=@object-ui/app-shell --filter=@object-ui/console --concurrency=2— Tasks 76 successful, 76 total.pnpm check:new-line-citations(ui) — 0 new citations.scripts/ablation-replace.mjs:setEmailDeliveryOff(config?.features?.emailDelivery === false);replaced bysetEmailDeliveryOff(false);— 3 of the new tests fail (no-mail text, known/unknown parity, translated labels), 7 pass; restore verified blob == HEAD andgit diff HEADempty. (The three keep-old-text cases pass under the mutation by design.)Verification
Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 35 commands, all run, each exit 0, includingnode scripts/check-sdui-manifest.mjsandpnpm --dir ui exec vitest run scripts/(170 files passed).--ranreconciliation: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN;pnpm check:changeset-fixedalso run (outside the derivation), exit 0. CI type-check lanes are left to CI.Acceptance notes
ui/packages/auth/src/types.ts(theemailDeliverydeclaration onAuthPublicConfig.features) is outside the listed surface: without it the read does not type-check.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (eslint on changed files; full run is CI's)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CYv3DdXJ81i2yQpGKm
Generated by Claude Code