diff --git a/packages/builder/src/pages/builder/portal/settings/auth/index.svelte b/packages/builder/src/pages/builder/portal/settings/auth/index.svelte index 2d4dc7ee46..c54518decc 100644 --- a/packages/builder/src/pages/builder/portal/settings/auth/index.svelte +++ b/packages/builder/src/pages/builder/portal/settings/auth/index.svelte @@ -31,6 +31,7 @@ const ConfigTypes = { Google: "google", OIDC: "oidc", + SCIM: "scim", } const HasSpacesRegex = /[\\"\s]/ @@ -160,6 +161,8 @@ providers.oidc?.config?.configs[0].clientSecret ) + $: scimEnabled = true + const onFileSelected = e => { let fileName = e.target.files[0].name image = e.target.files[0] @@ -253,6 +256,19 @@ originalGoogleDoc = cloneDeep(providers.google) } + async function saveSCIM() { + try { + const res = await saveConfig({ + type: "scim", + enabled: scimEnabled, + }) + notifications.success(`Settings saved`) + } catch (e) { + notifications.error(e.message) + return + } + } + let defaultScopes = ["profile", "email", "offline_access"] const refreshScopes = idx => { @@ -343,6 +359,14 @@ originalOidcDoc = cloneDeep(oidcDoc) providers.oidc = oidcDoc } + + try { + const scimConfig = await API.getConfig(ConfigTypes.SCIM) + scimEnabled = scimConfig?.enabled + } catch (error) { + console.error(error) + notifications.error("Error fetching SCIM config") + } }) @@ -606,11 +630,28 @@ +