From c048156e19f710f3bc2b3671dc22c925ffceec54 Mon Sep 17 00:00:00 2001 From: David Leek Date: Mon, 29 Apr 2024 13:14:39 +0200 Subject: [PATCH] fix: disable SCIM for OIDC, nothing to test it on (#6937) disable SCIM for OIDC, nothing to test it on Also checks scim enabled before saving --- .../admin/auth/OidcAuth/OidcAuth.tsx | 48 ------------------- .../admin/auth/SamlAuth/SamlAuth.tsx | 8 ++-- 2 files changed, 5 insertions(+), 51 deletions(-) diff --git a/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx b/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx index 570e8bb988..d6cb4e64ac 100644 --- a/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx +++ b/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx @@ -21,10 +21,6 @@ import { formatUnknownError } from 'utils/formatUnknownError'; import { removeEmptyStringFields } from 'utils/removeEmptyStringFields'; import { SsoGroupSettings } from '../SsoGroupSettings'; import type { IRole } from 'interfaces/role'; -import { useUiFlag } from 'hooks/useUiFlag'; -import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { useScim } from 'hooks/useScim'; -import { ScimConfigSettings } from '../ScimSettings/ScimSettings'; const initialState = { enabled: false, @@ -89,22 +85,6 @@ export const OidcAuth = () => { }); }; - const { - settings, - enabled, - setEnabled, - assumeControlOfExisting, - setAssumeControlOfExisting, - newToken, - tokenGenerationDialog, - setTokenGenerationDialog, - tokenDialog, - setTokenDialog, - loading: scimLoading, - saveScimSettings, - onGenerateNewTokenConfirm, - } = useScim(); - const onSubmit = async (event: React.SyntheticEvent) => { event.preventDefault(); @@ -114,14 +94,11 @@ export const OidcAuth = () => { title: 'Settings stored', type: 'success', }); - saveScimSettings(); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); } }; - const scimEnabled = useUiFlag('scimApi'); - return ( <> @@ -279,31 +256,6 @@ export const OidcAuth = () => { setValue={setValue} /> - - } - /> - { }); }; + const scimEnabled = useUiFlag('scimApi'); + const { settings, enabled, @@ -105,14 +107,14 @@ export const SamlAuth = () => { title: 'Settings stored', type: 'success', }); - saveScimSettings(); + if (scimEnabled) { + saveScimSettings(); + } } catch (error: unknown) { setToastApiError(formatUnknownError(error)); } }; - const scimEnabled = useUiFlag('scimApi'); - return ( <>