11import {
22 disabledOrganizationAPIKeysFeature ,
33 disabledOrganizationBillingFeature ,
4+ disabledSelfServeSSOFeature ,
45 disabledUserAPIKeysFeature ,
56 disabledUserBillingFeature ,
67} from '@clerk/shared/internal/clerk-js/componentGuards' ;
@@ -9,7 +10,7 @@ import type { CustomPage, EnvironmentResource, LoadedClerk } from '@clerk/shared
910
1011import { ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID , USER_PROFILE_NAVBAR_ROUTE_ID } from '../constants' ;
1112import type { NavbarRoute } from '../elements/Navbar' ;
12- import { Code , CreditCard , Organization , TickShield , User , Users } from '../icons' ;
13+ import { Code , CreditCard , LinkIcon , Organization , TickShield , User , Users } from '../icons' ;
1314import { localizationKeys } from '../localization' ;
1415import { ExternalElementMounter } from './ExternalElementMounter' ;
1516import { isDevelopmentSDK } from './runtimeEnvironment' ;
@@ -48,7 +49,15 @@ type GetDefaultRoutesReturnType = {
4849
4950type CreateCustomPagesParams = {
5051 customPages : CustomPage [ ] ;
51- getDefaultRoutes : ( { commerce, apiKeys } : { commerce : boolean ; apiKeys : boolean } ) => GetDefaultRoutesReturnType ;
52+ getDefaultRoutes : ( {
53+ commerce,
54+ apiKeys,
55+ selfServeSso,
56+ } : {
57+ commerce : boolean ;
58+ apiKeys : boolean ;
59+ selfServeSso : boolean ;
60+ } ) => GetDefaultRoutesReturnType ;
5261 setFirstPathToRoot : ( routes : NavbarRoute [ ] ) => NavbarRoute [ ] ;
5362 excludedPathsFromDuplicateWarning : string [ ] ;
5463} ;
@@ -106,6 +115,7 @@ const createCustomPages = (
106115 apiKeys : organization
107116 ? ! disabledOrganizationAPIKeysFeature ( clerk , environment )
108117 : ! disabledUserAPIKeysFeature ( clerk , environment ) ,
118+ selfServeSso : organization ? ! disabledSelfServeSSOFeature ( clerk , environment ) : false ,
109119 } ) ;
110120
111121 if ( isDevelopmentSDK ( clerk ) ) {
@@ -315,9 +325,11 @@ const getUserProfileDefaultRoutes = ({
315325const getOrganizationProfileDefaultRoutes = ( {
316326 commerce,
317327 apiKeys,
328+ selfServeSso,
318329} : {
319330 commerce : boolean ;
320331 apiKeys : boolean ;
332+ selfServeSso : boolean ;
321333} ) : GetDefaultRoutesReturnType => {
322334 const INITIAL_ROUTES : NavbarRoute [ ] = [
323335 {
@@ -349,6 +361,14 @@ const getOrganizationProfileDefaultRoutes = ({
349361 path : 'organization-api-keys' ,
350362 } ) ;
351363 }
364+ if ( selfServeSso ) {
365+ INITIAL_ROUTES . push ( {
366+ name : localizationKeys ( 'organizationProfile.navbar.selfServeSso' ) ,
367+ id : ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID . SELF_SERVE_SSO ,
368+ icon : LinkIcon ,
369+ path : 'organization-self-serve-sso' ,
370+ } ) ;
371+ }
352372
353373 const pageToRootNavbarRouteMap : Record < string , NavbarRoute > = {
354374 'invite-members' : INITIAL_ROUTES . find ( r => r . id === ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID . MEMBERS ) as NavbarRoute ,
0 commit comments