From 8d48b0abff08195a436f98bf8d42c45de51930df Mon Sep 17 00:00:00 2001 From: Anso Date: Sat, 28 Mar 2026 03:56:42 -0400 Subject: [PATCH] fix: gate SSO and Audit behind Team Pro license tier (#213) SSO settings tab and content were visible to Personal Pro users despite being a Team Pro-only feature. Added TeamProGate component that checks both isPro and variant === 'team', and hid the SSO nav button for non-Team Pro users. Audit was already correctly gated in EditorLayout. --- frontend/src/components/SSOSection.tsx | 8 +-- frontend/src/components/SettingsModal.tsx | 2 +- frontend/src/components/TeamProGate.tsx | 73 +++++++++++++++++++++++ 3 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 frontend/src/components/TeamProGate.tsx diff --git a/frontend/src/components/SSOSection.tsx b/frontend/src/components/SSOSection.tsx index f0d7274c..40f160c0 100644 --- a/frontend/src/components/SSOSection.tsx +++ b/frontend/src/components/SSOSection.tsx @@ -7,7 +7,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@ import { Badge } from '@/components/ui/badge'; import { toast } from 'sonner'; import { apiFetch } from '@/lib/api'; -import { ProGate } from './ProGate'; +import { TeamProGate } from './TeamProGate'; import { Shield, Loader2, CheckCircle, XCircle } from 'lucide-react'; interface SSOProviderConfig { @@ -320,7 +320,7 @@ export function SSOSection() { try { const res = await apiFetch('/sso/config'); if (res.ok) setConfigs(await res.json()); - } catch { /* ignore - ProGate will handle non-pro */ } + } catch { /* ignore - TeamProGate will handle non-pro */ } }; // eslint-disable-next-line react-hooks/set-state-in-effect @@ -329,7 +329,7 @@ export function SSOSection() { const getConfig = (provider: string) => configs.find(c => c.provider === provider) || null; return ( - +

@@ -360,6 +360,6 @@ export function SSOSection() {

For OIDC providers, set the OAuth callback URL to: {'https:///api/auth/sso/oidc//callback'}

-
+ ); } diff --git a/frontend/src/components/SettingsModal.tsx b/frontend/src/components/SettingsModal.tsx index 3943b608..5ffac0b3 100644 --- a/frontend/src/components/SettingsModal.tsx +++ b/frontend/src/components/SettingsModal.tsx @@ -998,7 +998,7 @@ export function SettingsModal({ isOpen, onClose }: SettingsModalProps) { {!isRemote && isAdmin && ( } label="Users" /> )} - {!isRemote && isAdmin && ( + {!isRemote && isAdmin && isPro && license?.variant === 'team' && ( } label="SSO" /> )} {children}; + + if (dismissed) { + return ( +
+
+ {children} +
+
+
+ + Upgrade to Team Pro to unlock +
+
+
+ ); + } + + return ( +
+
+ +
+
+

{featureName} requires Sencho Team Pro

+

+ Unlock team features like SSO authentication, audit logging, and unlimited user accounts with a Sencho Team Pro license. +

+
+
+ + +
+
+ ); +}