@@ -1462,29 +1462,43 @@ export class Clerk implements ClerkInterface {
14621462 * @param props Configuration parameters.
14631463 */
14641464 public mountConfigureSSO = ( node : HTMLDivElement , props ?: ConfigureSSOProps ) => {
1465- if ( disabledSelfServeSSOFeature ( this , this . environment ) ) {
1465+ const { isEnabled : isOrganizationsEnabled } = this . __internal_attemptToEnableEnvironmentSetting ( {
1466+ for : 'organizations' ,
1467+ caller : 'ConfigureSSO' ,
1468+ onClose : ( ) => {
1469+ throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'ConfigureSSO' ) , {
1470+ code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
1471+ } ) ;
1472+ } ,
1473+ } ) ;
1474+
1475+ if ( ! isOrganizationsEnabled ) {
1476+ return ;
1477+ }
1478+
1479+ const userExists = ! noUserExists ( this ) ;
1480+ if ( noOrganizationExists ( this ) && userExists ) {
14661481 if ( this . #instanceType === 'development' ) {
1467- throw new ClerkRuntimeError ( warnings . cannotRenderConfigureSSOComponentWhenDisabled , {
1468- code : CANNOT_RENDER_SELF_SERVE_SSO_DISABLED_ERROR_CODE ,
1482+ throw new ClerkRuntimeError ( warnings . cannotRenderComponentWhenOrgDoesNotExist , {
1483+ code : CANNOT_RENDER_ORGANIZATION_MISSING_ERROR_CODE ,
14691484 } ) ;
14701485 }
14711486 return ;
14721487 }
14731488
1474- if ( disabledEmailAddressAttribute ( this , this . environment ) ) {
1489+ if ( disabledSelfServeSSOFeature ( this , this . environment ) ) {
14751490 if ( this . #instanceType === 'development' ) {
1476- throw new ClerkRuntimeError ( warnings . cannotRenderConfigureSSOComponentWhenEmailAddressDisabled , {
1477- code : CANNOT_RENDER_CONFIGURE_SSO_EMAIL_ADDRESS_DISABLED_ERROR_CODE ,
1491+ throw new ClerkRuntimeError ( warnings . cannotRenderConfigureSSOComponentWhenDisabled , {
1492+ code : CANNOT_RENDER_SELF_SERVE_SSO_DISABLED_ERROR_CODE ,
14781493 } ) ;
14791494 }
14801495 return ;
14811496 }
14821497
1483- const userExists = ! noUserExists ( this ) ;
1484- if ( noOrganizationExists ( this ) && userExists ) {
1498+ if ( disabledEmailAddressAttribute ( this , this . environment ) ) {
14851499 if ( this . #instanceType === 'development' ) {
1486- throw new ClerkRuntimeError ( warnings . cannotRenderComponentWhenOrgDoesNotExist , {
1487- code : CANNOT_RENDER_ORGANIZATION_MISSING_ERROR_CODE ,
1500+ throw new ClerkRuntimeError ( warnings . cannotRenderConfigureSSOComponentWhenEmailAddressDisabled , {
1501+ code : CANNOT_RENDER_CONFIGURE_SSO_EMAIL_ADDRESS_DISABLED_ERROR_CODE ,
14881502 } ) ;
14891503 }
14901504 return ;
0 commit comments