Skip to content

fix(auth): draw the phone way in on first paint when email+password is off and no single sign-on exists - #31533

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-houx42
Nov 8, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-houx42

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #31492

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:邮箱+密码登录关闭、未提供也未强制单点登录、但开了手机登录时,登录卡片首屏直接给出手机号+密码与验证码登录,不再折叠成单点登录视图,也不再出现「返回单点登录」按钮;账号框此时写「手机号」。
  • 为什么改:只靠手机登录的部署,用户打开登录页只看到「改用密码登录」,点进去还有一个指向并不存在的单点登录的返回按钮,首屏没有入口。
  • 风险与回滚:风险低,只改 @object-ui/auth 的 LoginForm 一个组件的显示判定;有单点登录、强制单点登录、无任何登录方式、配置读取失败这几种情况保持原样(有对照测试)。回滚即 revert 本 PR。
  • 先看:ui/packages/auth/src/LoginForm.tsx 的 passwordFormCollapsed 与 formMode 两处;ui/packages/auth/src/__tests__/noSignInMethod-29159.test.tsx 新增的 describe。
  • 两分钟验证:cd ui && pnpm exec vitest run packages/auth/src/__tests__/noSignInMethod-29159.test.tsx,预期 16 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

ui/packages/auth/src/LoginForm.tsx, the card's Mechanism quoted: "passwordFormCollapsed = ssoEnforced || passwordSignInOff (line 342), and the backToSsoText button renders on passwordFormCollapsed && showPasswordFallback (line 788). #29159 gated only the copy (ssoOnlyCopy, line 510, which checks ssoEnforced || ssoEnabled); the collapse and the back button are not gated on SSO being present."

  • Collapse. passwordFormCollapsed = ssoEnforced || (passwordSignInOff && (ssoEnabled || !phoneSignInOffered)), where phoneSignInOffered = phonePasswordEnabled || phoneOtpEnabled. The one cell that changes is the password door shut, features.sso false, features.ssoEnforced false and a phone way in advertised: the form is drawn on first paint. Every other cell keeps today's collapse. Decided from the advertised config only; a failed config fetch leaves every flag at its default and keeps the password form (break-glass).
  • Back to single sign-on. No new condition: the button still renders on passwordFormCollapsed && showPasswordFallback. After the change the form collapses only where SSO is enforced or offered, or where the door is shut with no phone way in, and in that last cell the break-glass link is never offered (breakGlassOffered = !passwordSignInOff || phonePasswordEnabled), so the button can only be reached where there is single sign-on to go back to. The comment above it says so.
  • OTP-only server. With the password door shut and phone OTP the only way in, the form opens on the verification-code step (formMode) and does not offer "Sign in with password instead", a switch to a form the server refuses. Without this, the uncollapsed card would have drawn an email+password form on first paint.
  • Identifier label. The brief asked me to report whether the identifier keeps reading "Email or phone number" while email sign-in is refused. I changed it: with the password door shut and phone+password on, the field reads "Phone number", with the phone placeholder and type="tel". It reuses the existing phoneLabel / phonePlaceholder labels, which the Console already fills from auth.login.phoneLabel / auth.login.phonePlaceholder. No locale key is added, so Clause-②: no holds. Reason: the server refuses an email address there (EMAIL_PASSWORD_DISABLED), so offering one is a way in that does not exist. Submit routing is unchanged: a phone-shaped entry goes to phone+password.
  • Doors the server refuses stay hidden. The sign-up link stays hidden while emailPassword.enabled is false, as before (it used to ride on the collapse). The host's password-form description ("Enter your email and password to continue") is not drawn either, matching the no-method state. The Console renders with hideHeader, so its card is unaffected by the description change.

Tests

ui/packages/auth/src/__tests__/noSignInMethod-29159.test.tsx holds the password-off config matrix, so the new cases go there as one top-level describe (no new file). Its client helper gained an overrides argument for the sign-in spies.

  • Password off + phone (both ways) + no SSO, the card's repro config: not collapsed; "Phone number", Password and "Sign in with verification code" on first paint; no "Use a password instead", no "Back to single sign-on", no SSO copy, no sign-up, no password-form description.
  • The same in the verification-code form (under hideHeader, as the Console renders it): no back button, and the switch back to phone+password is offered.
  • A phone number and password entered on first paint call signInWithPhonePassword and not signIn.
  • Password off + phone OTP only: the verification-code form on first paint, with no password field and no switch to a password form.
  • Password off + phone+password only: the form with no verification-code link and no back button.
  • CONTROL, password off + phone + SSO advertised: still collapsed with the SSO button; break-glass opens the form and "Back to single sign-on" is there.
  • CONTROL, declared enforcement + password off + phone: still collapsed; break-glass and back return to the collapsed view.
  • Unchanged cells already pinned in the same file and in ssoEnforcedFirstPaint-29274.test.tsx, ssoEnforcedLoginCopy-12682.test.tsx and LoginForm.test.tsx: password off + SSO on, SSO enforced, no method at all, failed config fetch.
  • One existing case changed: "with password off and phone sign-in on, is not the no-method state" clicked "Use a password instead" to reach the OTP link. That click path was the defect. It now asserts the OTP link on first paint.
Readings (fix commit f0a0c9c on base d02c99e; head 3a40e3e after merging main f4b1f9e)
  • pnpm exec vitest run packages/auth/src/__tests__/ from ui/, locked: base d02c99e 45 files / 398 tests passed; f0a0c9c 45 files / 405 tests passed; head 3a40e3e (after rebuilding the auth closure) 45 files / 405 tests passed.
  • Ablation, run through scripts/ablation-replace.mjs on the committed head: passwordFormCollapsed restored to ssoEnforced || passwordSignInOff, anchor 1 to 0, blob af50e015 to 7530ce6b. noSignInMethod-29159.test.tsx went to 6 failed / 10 passed: the five new phone-only cases plus the edited existing case. Both CONTROLs stayed green. Restored: blob equal to HEAD (af50e015) and git diff HEAD empty.
  • pnpm exec turbo run type-check --filter=@object-ui/auth: exit 0 (tsc --noEmit && tsc -p tsconfig.test.json), on f0a0c9c and again on 3a40e3e.
  • pnpm exec eslint on both touched source files, from ui/: exit 0.

Acceptance notes

  • With the password door shut and SSO offered, a server that offers phone OTP but not phone+password still hides the OTP way in behind the collapse: there is no password door, so no break-glass link is offered. The card leaves that cell unchanged by design ("password off + SSO on (unchanged collapse)"). Noted here, not fixed.
  • With the password door shut, no SSO, a phone way in and a social provider, the provider divider still reads the host's orText ("or continue with email" by default) above a phone form. Copy only. Noted, not fixed.
  • Live dogfood shot: not taken (optional per the brief).

Verification

The derived gate list (node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, 36 commands, the same list on both heads) was run locally on f0a0c9c and again on head 3a40e3e: 36 of 36 exit 0 each time, and --ran reconciles 36 derived, 36 run, 0 NOT-MEASURED. That includes node scripts/check-sdui-manifest.mjs (exit 0) and pnpm --dir ui exec vitest run scripts/ (170 files passed, 2 skipped). Per-command exit codes are in the os-dev report on the card. CI runs the rest.


Generated by Claude Code

…s off and no single sign-on exists

With the password door shut, LoginForm collapsed into the single sign-on
view whether or not single sign-on existed, so a phone-only deployment
showed "Use a password instead" and then "Back to single sign-on". The
form is now drawn on first paint when no SSO is offered or enforced and
phone sign-in is advertised; the identifier reads "Phone number", an
OTP-only server opens on the verification-code step, and the back button
is only drawn where single sign-on exists.

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

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo

席位核对 · ACCEPT · 2026-11-08T13:41Z · head 3a40e3e178dbf9295089b794b2f58ecc8f4a72ba

Seat domain:ui#3 reviewed the diff of its own dispatch (claim 6721365334 on #31492, card thread session_01QsR2jTpDZ3S2UNafH1sonG, report 6722099750). Checked against GitHub, not against the report.

  1. Shape: 3 files, +217 / -25, draft on main. passwordFormCollapsed becomes ssoEnforced || (passwordSignInOff && (ssoEnabled || !phoneSignInOffered)), so a shut password door with a phone way in and no single sign-on draws the form on first paint. An OTP-only server opens on the OTP step and offers no switch to a password form it refuses (formMode). With email sign-in refused and phone+password on, the identifier reads the existing phoneLabel / phonePlaceholder with type="tel". No new locale key. For the newly uncollapsed cell, sign-up and the host password-form description stay hidden as they were while collapsed. The back-to-SSO button keeps its condition and is now reachable only where SSO is enforced or offered. Body: Fixes #31492 only.
  2. Premise: on origin/main the collapse was ssoEnforced || passwordSignInOff, with no check for SSO, and the back button rendered on passwordFormCollapsed && showPasswordFallback.
  3. Gates / check-runs: 55 runs on this head, 44 success, 11 skipped, 0 red. mergeable_state clean. Dev: 36/36 derived gates exit 0 on both heads, --ran reconciled; auth suite 45 files / 405 tests green; ablation (old collapse restored) 6 red with both controls green, restore proven.
  4. Accepted deviations / notes: one existing case in noSignInMethod-29159.test.tsx reached the OTP link through break-glass, which is the defect itself; it now finds the link on first paint. It is inside the claim's test surface. Left as is, read from source only: password off with SSO offered and OTP only still keeps OTP behind the collapse. That cell is unchanged per the brief, and its reach is not measured, so no card is filed yet.
  5. Out of scope / Skills-docs: Metadata-protocol: none; Skills-docs: not owed. The changeset sentences were read against the diff: each describes behaviour the diff ships.
  6. Landing: check-governed-merges --pr 31533: NOT governed, 242 changed lines, so no human approval owed. Clause-②: no: no declaration review owed. Serial: no other in-flight PR of this seat touches ui/packages/auth. Landing on the maintainer's standing rule that fleet PRs are reviewed and landed by the pm-dispatch skill (2026-11-03T04:52Z), in this project. Relay pr_ready, then automerge_enable.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 8, 2026 13:43
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 8, 2026 13:43
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 8a83814 Nov 8, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-houx42 branch November 8, 2026 13:59
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/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant