@@ -31,7 +31,6 @@ import { Paragraph } from "~/components/primitives/Paragraph";
3131import { Select , SelectItem } from "~/components/primitives/Select" ;
3232import { Switch } from "~/components/primitives/Switch" ;
3333import { $replica } from "~/db.server" ;
34- import { featuresForRequest } from "~/features.server" ;
3534import { useOrganization } from "~/hooks/useOrganizations" ;
3635import { rbac } from "~/services/rbac.server" ;
3736import { ssoController } from "~/services/sso.server" ;
@@ -79,12 +78,8 @@ export const loader = dashboardLoader(
7978 authorization : { action : "manage" , resource : { type : "sso" } } ,
8079 } ,
8180 async ( { context, request } ) => {
82- const { isManagedCloud } = featuresForRequest ( request ) ;
83- // Gate on managed cloud AND the SSO plugin actually being loaded
84- // (SSO_ENABLED off → OSS fallback → isUsingPlugin false). Without
85- // this the page renders for every managed-cloud org even when SSO
86- // is disabled for the deployment.
87- if ( ! isManagedCloud || ! ( await ssoController . isUsingPlugin ( ) ) ) {
81+ // True only when SSO_ENABLED is on and a real SSO plugin is loaded.
82+ if ( ! ( await ssoController . isUsingPlugin ( ) ) ) {
8883 throw new Response ( "Not Found" , { status : 404 } ) ;
8984 }
9085
@@ -175,8 +170,8 @@ export const action = dashboardAction(
175170 throw new Response ( "Not Found" , { status : 404 } ) ;
176171 }
177172
178- const { isManagedCloud } = featuresForRequest ( request ) ;
179- if ( ! isManagedCloud ) {
173+ // Mirror the loader gate.
174+ if ( ! ( await ssoController . isUsingPlugin ( ) ) ) {
180175 throw new Response ( "Not Found" , { status : 404 } ) ;
181176 }
182177 await requireSsoEntitlement ( orgId ) ;
0 commit comments