Repository navigation
fix(auth): the sign-in card says no sign-in method is available instead of SSO-only copy when email+password is off - #29257
Conversation
…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
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTH6JZayCDwSkR11qj
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTH6JZayCDwSkR11qj
|
domain:ui#5 · zhuangjianguo · session_01QsR2jQjvWkZ7is6GXbC6DB Contract reviewServed-tier: Face: the ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:ui#5 · zhuangjianguo · session_01QsR2jQjvWkZ7is6GXbC6DB 席位核对 — ACCEPT ·
|
Requested by Steedos · project thread
Fixes #29159
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
ui/packages/auth/src/LoginForm.tsx(ssoEnforced 只认服务器声明、noSignInMethod 判断、break-glass 链接的条件);ui/packages/auth/src/__tests__/noSignInMethod-29159.test.tsx。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/authLoginForm: SSO enforcement comes only from the server'sfeatures.ssoEnforced. The server keepsemailPassword.enabledtrue under enforcement (break-glass), soenabled: falsenow reads as "the password door is shut", not as enforcement. Derived state:features.ssois true;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.LoginFormLabels.noSignInMethodText;auth.login.noSignInMethodTextin 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./auth/configread still falls back to the password form.Tests
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 underhideHeaderwith 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 "treatsemailPassword.enabled === falseas enforced" case now pins the new reading.8a6b2ec5(base49aba82b), 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 in8a6b2ec5); the two new/changed files re-ran three times, 35/35 each.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, blob100d93a2toc77d644f), restored to the HEAD blob withgit diff HEADempty. The no-method case itself does not move under that ablation: it is held bynoSignInMethod, not by the derivation.turbo run type-checkfor@object-ui/auth,i18n,app-shell,console: 74/74 tasks, 0error TS.pnpm --dir ui exec vitest run scripts/: 169 passed, 2 skipped.main(01252a45) into heade1a2c064: 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, andcheck-sdui-manifest,check-changeset-no-major,check-empty-changesetandcheck:nul-bytesre-ran exit 0.Acceptance notes
features.ssotrue (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 withfeatures.ssotrue (pre-existing). A password-less SSO entry is a follow-up shape, not this card.features.phoneNumber) counts as a door: better-auth's/sign-in/phone-numberdoes not reademailAndPassword.enabled.Verification
Real browser: password sign-in off on a fresh showcase backend
Fresh
pnpm dev -- --fresh -p PORTat8a6b2ec5, Console Vite dev server from this tree (it aliases@object-ui/authandapp-shellto source), Playwright Chromium in a fresh context per locale.PUT /api/settings/auth {"values":{"email_password_enabled":false}}answered 200.GET /api/v1/auth/configthen reademailPassword.enabled:false,features.sso:false,ssoEnforced:false,phoneNumber:false,phoneNumberOtp:false,socialProviders:[], andPOST /sign-in/emailanswered400 EMAIL_PASSWORD_DISABLED./loginat 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." / 「当前没有可用的登录方式,请联系管理员。」email_password_enabled:trueagain, 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 frommain.Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat8a6b2ec5: 34 families, each run, each exit 0, includingnode scripts/check-sdui-manifest.mjsand its--self-test.--ranreconciliation: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.Generated by Claude Code