Skip to content

fix(auth): the sign-in card says no sign-in method is available instead of SSO-only copy when email+password is off - #29257

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

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-ftpl8z

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #29159

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:管理员关掉邮箱密码登录、又没有配 SSO / 第三方登录 / 手机登录时,登录页不再显示「请用组织的单点登录」和一个点进去会被服务器拒绝的「改用密码」链接,而是明确写出「当前没有可用的登录方式,请联系管理员」。
  • 为什么改:原来前端把「邮箱密码关闭」当成「强制 SSO」,整页没有一条能走通的路,用户只能以为系统坏了;登录页应只展示服务器真正提供的登录方式。
  • 风险与回滚:只改登录卡片的显示判断,服务器行为不变;真正开启强制 SSO 的环境照旧显示 SSO 专属视图,读取登录配置失败时照旧退回密码表单。回滚即 revert 本 PR。
  • 先看:ui/packages/auth/src/LoginForm.tsx(ssoEnforced 只认服务器声明、noSignInMethod 判断、break-glass 链接的条件);ui/packages/auth/src/__tests__/noSignInMethod-29159.test.tsx。
  • 两分钟验证:在 showcase 上以管理员 PUT /api/settings/auth {"values":{"email_password_enabled":false}},用无痕窗口打开 /_console/login,应看到「No sign-in method is available. Contact your administrator.」,没有 SSO 文案,也没有「Use a password instead」。
  • 需要你做的:无,席位落地。

What changes

  • @object-ui/auth LoginForm: SSO enforcement comes only from the server's features.ssoEnforced. The server keeps emailPassword.enabled true under enforcement (break-glass), so enabled: false now reads as "the password door is shut", not as enforcement. Derived state:
    • the password form collapses under declared enforcement or when the password door is shut (as before for both);
    • the SSO line ("Sign in with your organization's single sign-on") is drawn only under declared enforcement or when features.sso is true;
    • the "Use a password instead" link is drawn only while the form it opens holds a method the server accepts: email+password, the SSO button (routes the entered email), or phone+password;
    • with the password door shut and no SSO, no social/OIDC provider, no phone+password and no phone OTP, the card shows a role="status" line, "No sign-in method is available. Contact your administrator.", with no form, no link and no sign-up link. Social providers are read from the same config read, so the state never paints before the provider list lands.
  • New optional label LoginFormLabels.noSignInMethodText; auth.login.noSignInMethodText in all ten locale packs; both login pages (ui/apps/console/src/pages/auth/LoginPage.tsx, ui/packages/app-shell/src/console/auth/LoginPage.tsx) pass it.
  • Unchanged: an SSO-enforced deployment keeps its SSO-only view and break-glass link; a failed /auth/config read still falls back to the password form.

Tests

  • New ui/packages/auth/src/__tests__/noSignInMethod-29159.test.tsx (9 cases): the QA config {emailPassword.enabled:false, features.sso:false, ssoEnforced:false} shows the no-method state with no SSO copy, no password link, no form, no sign-up (also under hideHeader with a translated label); {ssoEnforced:true, sso:true} keeps the SSO-only view; declared enforcement with password off keeps the SSO copy without a refused password link; password off with only a provider, with SSO, or with phone sign-in stays usable; a failed fetch keeps the password form.
  • LoginForm.test.tsx: the old "treats emailPassword.enabled === false as enforced" case now pins the new reading.
  • Runs at head 8a6b2ec5 (base 49aba82b), locked, --maxWorkers=2:
    • pnpm exec vitest run packages/auth/ plus the 34 console, app-shell and i18n test files naming LoginForm, LoginPage or auth.login: Test Files 75/75 after the provider-button await fix (first run: one case read the async provider button synchronously, fixed in 8a6b2ec5); the two new/changed files re-ran three times, 35/35 each.
    • Ablation through scripts/ablation-replace.mjs: restoring the old derivation (ssoEnforced === true || emailPassword.enabled === false) reds 2 of 35: "with password off and only a provider…" and "with password off and phone sign-in on…" (both draw SSO copy again). Mutation landed (anchor 1 to 0, blob 100d93a2 to c77d644f), restored to the HEAD blob with git diff HEAD empty. The no-method case itself does not move under that ablation: it is held by noSignInMethod, not by the derivation.
    • turbo run type-check for @object-ui/auth, i18n, app-shell, console: 74/74 tasks, 0 error TS.
    • pnpm --dir ui exec vitest run scripts/: 169 passed, 2 skipped.
    • After merging main (01252a45) into head e1a2c064: no incoming commit touches the changed files; the same touched set (auth plus 35 consumer files) re-ran 76/76 files, 584/584 tests; the derived gate list is unchanged, and check-sdui-manifest, check-changeset-no-major, check-empty-changeset and check:nul-bytes re-ran exit 0.

Acceptance notes

  • With the password door shut and features.sso true (no enforcement), the email-routed "Sign in with SSO" button is still reached through "Use a password instead", because that button lives inside the password form; the revealed form's password submit is then refused by the server. The same placement holds under declared enforcement with features.sso true (pre-existing). A password-less SSO entry is a follow-up shape, not this card.
  • Phone+password sign-in (features.phoneNumber) counts as a door: better-auth's /sign-in/phone-number does not read emailAndPassword.enabled.

Verification

Real browser: password sign-in off on a fresh showcase backend

Fresh pnpm dev -- --fresh -p PORT at 8a6b2ec5, Console Vite dev server from this tree (it aliases @object-ui/auth and app-shell to source), Playwright Chromium in a fresh context per locale.

  1. As the dev admin, PUT /api/settings/auth {"values":{"email_password_enabled":false}} answered 200. GET /api/v1/auth/config then read emailPassword.enabled:false, features.sso:false, ssoEnforced:false, phoneNumber:false, phoneNumberOtp:false, socialProviders:[], and POST /sign-in/email answered 400 EMAIL_PASSWORD_DISABLED.
  2. /login at 1280x800 (en-US) and 390x844 (zh-CN): the no-method status present (1), SSO copy absent, "Use a password instead" absent (0), password field absent (0). Text: "No sign-in method is available. Contact your administrator." / 「当前没有可用的登录方式,请联系管理员。」
  3. Control: email_password_enabled:true again, the same pages draw the password field (1) and no status line (0).

The route was the Vite dev server's /login (base /), not the backend's prebuilt /_console/login, which serves the Console built from main.

Derived gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 8a6b2ec5: 34 families, each run, each exit 0, including node scripts/check-sdui-manifest.mjs and its --self-test. --ran reconciliation: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.


Generated by Claude Code

…O-only copy

LoginForm read emailPassword.enabled === false as SSO enforcement, so a
deployment with the password door shut and no SSO showed "Sign in with
your organization's single sign-on", no SSO button, and a "Use a password
instead" link to a form the server refuses. Enforcement now comes only from
the server's features.ssoEnforced; with no advertised door left the card
shows a plain no-method state (new noSignInMethodText label, translated in
all ten bundles and passed by both login pages).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTH6JZayCDwSkR11qj
@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 2, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#5 · zhuangjianguo · session_01QsR2jQjvWkZ7is6GXbC6DB

Contract review

Served-tier: TIER_DEFAULT
Head-sha: e1a2c0645542996b3224880ab886a98adb5eea46
Local-runs: none

Face: the Clause-②: yes (widening) declaration only (claim 6574037381 on #29159). The diff touches no packages/spec/src/** and no governed path (check-governed-merges --pr 29257: 0 of 16), and it declares no narrowing. The seat read the PR's 16-file diff at this head, card #29159 with its triage comment 6573315205, and the os-dev report 6574918165.

① Derived judgments

  • @object-ui/auth (published; index.ts:35 re-exports type LoginFormLabels): the type gains one optional member, noSignInMethodText?: string, with an English default in LoginForm. A host that passes no value is unchanged, and no member is removed or retyped. Additive, so this is correct as a widening.
  • @object-ui/i18n (published): auth.login.noSignInMethodText is added in all ten packs (10 hunks), so TranslationKeys gains one member. No key is removed or renamed. Additive, so correct.
  • @object-ui/app-shell and @object-ui/console: each sign-in page passes the new label (one line and four lines). There is no export change.
  • Behaviour: ssoEnforced now comes from features.ssoEnforced alone. emailPassword.enabled === false sets a separate passwordSignInOff, which still collapses the form. An older server that signalled enforcement with enabled: false and advertises SSO keeps the SSO copy, because ssoOnlyCopy holds on ssoEnabled. The no-method state needs password off plus no SSO, no enabled social provider and no phone OTP or phone password. A failed config fetch leaves every flag false, so the password form shows, as on main. The new suite covers each arm (9 cases), and an ablation of the old derivation reds 2 of 35 files (dev report).

② Semver level

.changeset/29159-login-no-sign-in-method.md bumps patch for @object-ui/auth, @object-ui/app-shell, @object-ui/i18n and @object-ui/console, with Clause-②: yes (widening) and Metadata-protocol: none copied verbatim. The change is additive only. Consistent.

③ Boundary flags

  • One out-of-scope finding, raised by the dev: the email-routed SSO button sits inside the password form. So with features.sso: true under a collapsed view, it is reached only through "Use a password instead". This behaviour predates the PR and is unchanged by it; the seat files it as a separate card.
  • Real browser: MEASURED by the dev (fresh showcase, email_password_enabled:false, en and zh, with a control leg).
  • PR author is objectstack-fleet[bot] (relay write).

Implemented-by: claude/project-thread-ftpl8z
Reviewed-by: session_01QsR2jQjvWkZ7is6GXbC6DB

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#5 · zhuangjianguo · session_01QsR2jQjvWkZ7is6GXbC6DB

席位核对 — ACCEPT · domain:ui#5 · head e1a2c064 · 2026-11-02T10:48Z

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