-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(webapp): gate SSO UI on plugin presence, not managed-cloud #4006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,14 +13,12 @@ import { FormError } from "~/components/primitives/FormError"; | |
| import { Header1 } from "~/components/primitives/Headers"; | ||
| import { Paragraph } from "~/components/primitives/Paragraph"; | ||
| import { TextLink } from "~/components/primitives/TextLink"; | ||
| import { featuresForRequest } from "~/features.server"; | ||
| import { isGithubAuthSupported, isGoogleAuthSupported } from "~/services/auth.server"; | ||
| import { getLastAuthMethod } from "~/services/lastAuthMethod.server"; | ||
| import { commitSession, setRedirectTo } from "~/services/redirectTo.server"; | ||
| import { getUserId } from "~/services/session.server"; | ||
| import { getUserSession } from "~/services/sessionStorage.server"; | ||
| import { ssoController } from "~/services/sso.server"; | ||
| import { flags as getGlobalFlags } from "~/v3/featureFlags.server"; | ||
| import { requestUrl } from "~/utils/requestUrl.server"; | ||
| import { SSO_SESSION_EXPIRED_REASON } from "~/utils/ssoSession"; | ||
| import { cn } from "~/utils/cn"; | ||
|
|
@@ -86,17 +84,8 @@ export async function loader({ request }: LoaderFunctionArgs) { | |
| ? "Your SSO session expired. Please sign in again." | ||
| : null; | ||
|
|
||
| const { isManagedCloud } = featuresForRequest(request); | ||
| // /login is unauthenticated and high-traffic; don't pay the plugin | ||
| // resolution + flag fetch on self-hosted where the result is unused. | ||
| let showSsoAuth = false; | ||
| if (isManagedCloud) { | ||
| const [pluginActive, globalFlags] = await Promise.all([ | ||
| ssoController.isUsingPlugin(), | ||
| getGlobalFlags(), | ||
| ]); | ||
| showSsoAuth = pluginActive && (globalFlags as Record<string, unknown>).hasSso === true; | ||
| } | ||
| // True only when SSO_ENABLED is on and a real SSO plugin is loaded. | ||
| const showSsoAuth = await ssoController.isUsingPlugin(); | ||
|
Comment on lines
+87
to
+88
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 Removal of hasSso feature flag eliminates runtime kill switch for SSO login button The old login loader required three conditions for showing SSO auth: Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| if (redirectTo) { | ||
| const session = await setRedirectTo(request, redirectTo); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Incomplete removal of isManagedCloud gate: sidebar SSO entry still hidden on self-hosted
The PR removes the
isManagedCloudcheck from the SSO settings loader/action and the login page, consolidating gating tossoController.isUsingPlugin(). However, the sidebar navigation atapps/webapp/app/components/navigation/OrganizationSettingsSideMenu.tsx:150still checksisManagedCloud && isSsoUsingPluginbefore rendering the SSO menu item. On a self-hosted deployment withSSO_ENABLED=trueand the plugin installed, the SSO settings page loads fine via direct URL, the login page shows the SSO auth option, and mutations work — but the sidebar won't show the SSO link becauseisManagedCloudis false. This makes the feature undiscoverable through normal navigation.Sidebar still gated on isManagedCloud
In
OrganizationSettingsSideMenu.tsx:150:This should be updated to just
isSsoUsingPluginto match the loader/action changes.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.