From 121a8e5e9aa2d78b7a71049ecf0e3d234dde1d6f Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Wed, 14 Jul 2021 16:21:17 +0100 Subject: [PATCH] Auto generate callback url and supply id on login --- .../builder/auth/_components/OIDCButton.svelte | 4 +++- .../pages/builder/portal/manage/auth/index.svelte | 14 +++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte b/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte index b220e2478b..d3a2f7c9a5 100644 --- a/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte +++ b/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte @@ -26,7 +26,9 @@ {#if show} - window.open("/api/admin/auth/oidc/", "_blank")}> + window.open(`/api/admin/auth/oidc/${$oidc.uuid}`, "_blank")} + >
oidc icon

{`Sign in with ${$oidc.name || "OIDC"}`}

diff --git a/packages/builder/src/pages/builder/portal/manage/auth/index.svelte b/packages/builder/src/pages/builder/portal/manage/auth/index.svelte index 46305924d9..e9548b8ec0 100644 --- a/packages/builder/src/pages/builder/portal/manage/auth/index.svelte +++ b/packages/builder/src/pages/builder/portal/manage/auth/index.svelte @@ -75,9 +75,13 @@ providers.google?.config.clientSecret && providers.google?.config.callbackURL $: oidcComplete = - providers.oidc?.config.configs[0].configUrl && - providers.oidc?.config.configs[0].clientID && - providers.oidc?.config.configs[0].clientSecret + providers.oidc?.config?.configs[0].configUrl && + providers.oidc?.config?.configs[0].clientID && + providers.oidc?.config?.configs[0].clientSecret + + $: oidcCallback = providers.oidc?.config.configs[0].uuid + ? `/api/admin/auth/oidc/callback/${providers.oidc?.config.configs[0].uuid}` + : "" async function uploadLogo(file) { let data = new FormData() @@ -234,6 +238,10 @@
{/each} +
+ + +

To customize your login button, fill out the fields below.