Repository navigation
fix(auth): draw the phone way in on first paint when email+password is off and no single sign-on exists - #31533
Merged
Conversation
…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
Contributor
Author
|
domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo 席位核对 · ACCEPT · 2026-11-08T13:41Z · head
|
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 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 thebackToSsoTextbutton renders onpasswordFormCollapsed && showPasswordFallback(line 788). #29159 gated only the copy (ssoOnlyCopy, line 510, which checksssoEnforced || ssoEnabled); the collapse and the back button are not gated on SSO being present."passwordFormCollapsed = ssoEnforced || (passwordSignInOff && (ssoEnabled || !phoneSignInOffered)), wherephoneSignInOffered = phonePasswordEnabled || phoneOtpEnabled. The one cell that changes is the password door shut,features.ssofalse,features.ssoEnforcedfalse 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).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.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.type="tel". It reuses the existingphoneLabel/phonePlaceholderlabels, which the Console already fills fromauth.login.phoneLabel/auth.login.phonePlaceholder. No locale key is added, soClause-②: noholds. 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.emailPassword.enabledis 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 withhideHeader, so its card is unaffected by the description change.Tests
ui/packages/auth/src/__tests__/noSignInMethod-29159.test.tsxholds the password-off config matrix, so the new cases go there as one top-leveldescribe(no new file). Its client helper gained anoverridesargument for the sign-in spies.hideHeader, as the Console renders it): no back button, and the switch back to phone+password is offered.signInWithPhonePasswordand notsignIn.ssoEnforcedFirstPaint-29274.test.tsx,ssoEnforcedLoginCopy-12682.test.tsxandLoginForm.test.tsx: password off + SSO on, SSO enforced, no method at all, failed config fetch.Readings (fix commit f0a0c9c on base d02c99e; head 3a40e3e after merging main f4b1f9e)
pnpm exec vitest run packages/auth/src/__tests__/fromui/, 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.scripts/ablation-replace.mjson the committed head:passwordFormCollapsedrestored tossoEnforced || passwordSignInOff, anchor 1 to 0, blob af50e015 to 7530ce6b.noSignInMethod-29159.test.tsxwent 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) andgit diff HEADempty.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 eslinton both touched source files, fromui/: exit 0.Acceptance notes
orText("or continue with email" by default) above a phone form. Copy only. Noted, not fixed.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--ranreconciles 36 derived, 36 run, 0 NOT-MEASURED. That includesnode scripts/check-sdui-manifest.mjs(exit 0) andpnpm --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