@@ -40,9 +40,6 @@ export function TeamSSO({ team }: { team: Team }) {
4040 const [ isGeneratingSSOLink , setIsGeneratingSSOLink ] = useState ( false ) ;
4141 const [ showDisableConfirmation , setShowDisableConfirmation ] = useState ( false ) ;
4242 const [ disableError , setDisableError ] = useState < string > ( ) ;
43- const [ automaticMembershipValue , setAutomaticMembershipValue ] =
44- useState ( false ) ;
45- const [ jitProvisioningValue , setJitProvisioningValue ] = useState ( false ) ;
4643 const [ requireSsoLoginValue , setRequireSsoLoginValue ] = useState ( false ) ;
4744 const [ isSavingSettings , setIsSavingSettings ] = useState ( false ) ;
4845 const [ showSaveConfirmation , setShowSaveConfirmation ] = useState ( false ) ;
@@ -53,18 +50,12 @@ export function TeamSSO({ team }: { team: Team }) {
5350 const ssoEnabled = entitlements ?. ssoEnabled ?? false ;
5451 const isSSOConfigured = ! ! ssoOrganization ;
5552 const domains = ssoOrganization ?. domains ?? [ ] ;
56- const automaticMembership = ssoOrganization ?. automaticMembership ?? false ;
57- const jitProvisioning = ssoOrganization ?. jitProvisioning ?? false ;
5853 const requireSsoLogin = ssoOrganization ?. requireSsoLogin ?? false ;
5954
6055 useEffect ( ( ) => {
6156 if ( isSSOConfigured && ssoOrganization ) {
62- setAutomaticMembershipValue ( ssoOrganization . automaticMembership ) ;
63- setJitProvisioningValue ( ssoOrganization . jitProvisioning ) ;
6457 setRequireSsoLoginValue ( ssoOrganization . requireSsoLogin ) ;
6558 } else if ( ! isSSOConfigured ) {
66- setAutomaticMembershipValue ( false ) ;
67- setJitProvisioningValue ( false ) ;
6859 setRequireSsoLoginValue ( false ) ;
6960 }
7061 } , [ isSSOConfigured , ssoOrganization ] ) ;
@@ -75,34 +66,6 @@ export function TeamSSO({ team }: { team: Team }) {
7566 }
7667 const changes : { title : string ; body : string } [ ] = [ ] ;
7768
78- if ( automaticMembershipValue !== automaticMembership ) {
79- changes . push (
80- automaticMembershipValue
81- ? {
82- title : "Enable Automatic Membership:" ,
83- body : "If a Convex account logs in with one of your verified domains, they will automatically be added to the Convex team as a team member." ,
84- }
85- : {
86- title : "Disable Automatic Membership:" ,
87- body : "Convex accounts logging in with one of your verified domains will no longer be added to the Convex team automatically." ,
88- } ,
89- ) ;
90- }
91-
92- if ( jitProvisioningValue !== jitProvisioning ) {
93- changes . push (
94- jitProvisioningValue
95- ? {
96- title : "Enable Just-in-Time Provisioning:" ,
97- body : "If a Convex account logs in with the configured SSO method, they will automatically be added to the Convex team as a team member." ,
98- }
99- : {
100- title : "Disable Just-in-Time Provisioning:" ,
101- body : "Convex accounts logging in with the configured SSO method will no longer be added to the Convex team automatically." ,
102- } ,
103- ) ;
104- }
105-
10669 if ( requireSsoLoginValue !== requireSsoLogin ) {
10770 if ( requireSsoLoginValue ) {
10871 changes . push ( {
@@ -118,15 +81,7 @@ export function TeamSSO({ team }: { team: Team }) {
11881 }
11982
12083 return changes ;
121- } , [
122- automaticMembership ,
123- automaticMembershipValue ,
124- isSSOConfigured ,
125- jitProvisioning ,
126- jitProvisioningValue ,
127- requireSsoLogin ,
128- requireSsoLoginValue ,
129- ] ) ;
84+ } , [ isSSOConfigured , requireSsoLogin , requireSsoLoginValue ] ) ;
13085 const hasChanges = pendingChanges . length > 0 ;
13186
13287 // Determine if any domain needs verification
@@ -137,14 +92,10 @@ export function TeamSSO({ team }: { team: Team }) {
13792
13893 const baseSettingDisabled =
13994 isSubmitting || ! hasAdminPermissions || ! ssoEnabled ;
140- const automaticMembershipDisabled = baseSettingDisabled ;
141- const jitProvisioningDisabled = baseSettingDisabled ;
14295 const requireSsoLoginDisabled = baseSettingDisabled ;
14396
14497 const handleSaveSettings = async ( ) => {
14598 const payload : UpdateSsoRequest = {
146- automaticMembership : automaticMembershipValue ,
147- jitProvisioning : jitProvisioningValue ,
14899 requireSsoLogin : requireSsoLoginValue ,
149100 } ;
150101 await updateSSO ( payload ) ;
@@ -383,49 +334,6 @@ export function TeamSSO({ team }: { team: Team }) {
383334 Additional Options
384335 </ h4 >
385336 < div className = "space-y-2" >
386- < label className = "ml-1 flex items-center gap-3 text-sm text-content-primary" >
387- < Checkbox
388- checked = { automaticMembershipValue }
389- disabled = { automaticMembershipDisabled }
390- onChange = { ( ) => {
391- if ( automaticMembershipDisabled ) {
392- return ;
393- }
394- setAutomaticMembershipValue (
395- ! automaticMembershipValue ,
396- ) ;
397- } }
398- />
399- < span className = "flex items-center gap-2" >
400- Automatic membership
401- < Tooltip
402- tip = "If a Convex account logs in with one of your verified domains, they will automatically be added to the Convex team as a team member."
403- side = "right"
404- >
405- < QuestionMarkCircledIcon className = "h-4 w-4 text-content-secondary" />
406- </ Tooltip >
407- </ span >
408- </ label >
409-
410- < label className = "ml-1 flex items-center gap-3 text-sm text-content-primary" >
411- < Checkbox
412- checked = { jitProvisioningValue }
413- disabled = { jitProvisioningDisabled }
414- onChange = { ( ) => {
415- setJitProvisioningValue ( ! jitProvisioningValue ) ;
416- } }
417- />
418- < span className = "flex items-center gap-2" >
419- Just-in-time provisioning
420- < Tooltip
421- tip = "If a Convex account logs in with the configured SSO method, they will automatically be added to the Convex team as a team member."
422- side = "right"
423- >
424- < QuestionMarkCircledIcon className = "h-4 w-4 text-content-secondary" />
425- </ Tooltip >
426- </ span >
427- </ label >
428-
429337 < label className = "ml-1 flex items-center gap-3 text-sm text-content-primary" >
430338 < Checkbox
431339 checked = { requireSsoLoginValue }
0 commit comments