mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: add enableSingleSignOut for OIDC
This commit is contained in:
		
							parent
							
								
									b5bb516c1c
								
							
						
					
					
						commit
						03665ed8db
					
				| @ -61,7 +61,7 @@ return ( | ||||
|                     labelId="defaultRootRole-label" | ||||
|                     id="defaultRootRole" | ||||
|                     name="defaultRootRole" | ||||
|                     disabled={!data.autoCreate} | ||||
|                     disabled={!data.autoCreate || !data.enabled} | ||||
|                     value={data.defaultRootRole || 'Editor'} | ||||
|                     onChange={updateDefaultRootRole} | ||||
|                     > | ||||
| @ -86,7 +86,7 @@ return ( | ||||
|                     onChange={updateField} | ||||
|                     label="Email domains" | ||||
|                     name="emailDomains" | ||||
|                     disabled={!data.autoCreate} | ||||
|                     disabled={!data.autoCreate || !data.enabled} | ||||
|                     required={!!data.autoCreate} | ||||
|                     value={data.emailDomains || ''} | ||||
|                     placeholder="@company.com, @anotherCompany.com" | ||||
|  | ||||
| @ -9,6 +9,7 @@ import AutoCreateForm from './AutoCreateForm/AutoCreateForm'; | ||||
| 
 | ||||
| const initialState = { | ||||
|     enabled: false, | ||||
|     enableSingleSignOut: false, | ||||
|     autoCreate: false, | ||||
|     unleashHostname: location.hostname, | ||||
| }; | ||||
| @ -47,6 +48,10 @@ function OidcAuth({ config, getOidcConfig, updateOidcConfig, unleashUrl }) { | ||||
|         setData({ ...data, enabled: !data.enabled }); | ||||
|     }; | ||||
| 
 | ||||
|     const updateSingleSignOut = () => { | ||||
|         setData({ ...data, enableSingleSignOut: !data.enableSingleSignOut }); | ||||
|     }; | ||||
| 
 | ||||
|     const setValue = (field, value) => { | ||||
|         setData({ | ||||
|             ...data, | ||||
| @ -93,7 +98,7 @@ function OidcAuth({ config, getOidcConfig, updateOidcConfig, unleashUrl }) { | ||||
|                         <strong>Enable</strong> | ||||
|                         <p>Enable Open Id Connect Authentication.</p> | ||||
|                     </Grid> | ||||
|                     <Grid item md={6}> | ||||
|                     <Grid item md={6} style={{ padding: '20px' }}> | ||||
|                         <FormControlLabel | ||||
|                             control={ <Switch | ||||
|                                 onChange={updateEnabled} | ||||
| @ -162,6 +167,25 @@ function OidcAuth({ config, getOidcConfig, updateOidcConfig, unleashUrl }) { | ||||
|                         /> | ||||
|                     </Grid> | ||||
|                 </Grid> | ||||
|                 <h3>Optional Configuration</h3> | ||||
|                 <Grid container spacing={3}> | ||||
|                     <Grid item md={5}> | ||||
|                         <strong>(Optional) Enable Single Sign-Out</strong> | ||||
|                         <p>If you enable Single Sign-Out Unleash will redirect the user to the IDP as part of the Sign-out process.</p> | ||||
|                     </Grid> | ||||
|                     <Grid item md={6} style={{ padding: '20px' }}> | ||||
|                         <FormControlLabel | ||||
|                             control={ <Switch | ||||
|                                 onChange={updateSingleSignOut} | ||||
|                                 value={data.enableSingleSignOut} | ||||
|                                 disabled={!data.enabled} | ||||
|                                 name="enableSingleSignOut" | ||||
|                                 checked={data.enableSingleSignOut} | ||||
|                             />} | ||||
|                             label={data.enableSingleSignOut ? 'Enabled' : 'Disabled'} | ||||
|                         /> | ||||
|                     </Grid> | ||||
|                 </Grid> | ||||
| 
 | ||||
|                 <AutoCreateForm data={data} setValue={setValue} /> | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user