fix(auth): server-gate the "Sign in with SSO" button on features.sso#2006
Merged
Conversation
LoginForm rendered the SSO button unconditionally, so a deployment without enterprise SSO wired (the default for self-hosted / os dev local runs) showed a button whose POST /sign-in/sso route isn't mounted — clicking it surfaced the misleading "No SSO provider is configured for this email domain." only at click time. The button is now gated on features.sso from GET /auth/config, mirroring how SocialSignInButtons already gates social providers. Defaults to hidden, so a failed config fetch or an older server that doesn't report the flag simply omits the button. Adds LoginForm.test.tsx covering off/absent/on/fetch-failure. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
Problem
On the console login page, the "Sign in with SSO" button renders unconditionally. On any deployment where enterprise SSO isn't wired (the default for self-hosted and
os devlocal runs),@better-auth/ssoisn't mounted, soPOST /sign-in/sso404s. The user only discovers SSO is unavailable after clicking, via the misleading banner:The button should be driven by server config, exactly like social providers already are 60 lines up in the same file (
SocialSignInButtonsqueries/auth/configand renders nothing when empty).Fix
LoginFormnow fetchesGET /auth/configand gates the SSO button onfeatures.sso:SocialSignInButtonspattern (samegetAuthConfig()seam).features.sso?: booleanto theAuthPublicConfigtype.Tests
New
LoginForm.test.tsxcovers: flag off → hidden,featuresabsent → hidden, flag on → shown, config fetch fails → hidden. Full@object-ui/authsuite green (111 tests), type-check clean.Pairs with
Requires the framework change that surfaces
features.sso: objectstack-ai/objectstack#2330🤖 Generated with Claude Code