Auto generate callback url and supply id on login

This commit is contained in:
Rory Powell 2021-07-14 16:21:17 +01:00
parent 3152bd1839
commit 6f1d995cc8
2 changed files with 14 additions and 4 deletions

View File

@ -26,7 +26,9 @@
</script>
{#if show}
<ActionButton on:click={() => window.open("/api/admin/auth/oidc/", "_blank")}>
<ActionButton
on:click={() => window.open(`/api/admin/auth/oidc/${$oidc.uuid}`, "_blank")}
>
<div class="inner">
<img {src} alt="oidc icon" />
<p>{`Sign in with ${$oidc.name || "OIDC"}`}</p>

View File

@ -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 @@
<Input bind:value={providers.oidc.config.configs[0][field]} />
</div>
{/each}
<div class="form-row">
<Label size="L">Callback URL</Label>
<Input readonly bind:value={oidcCallback} />
</div>
<br />
<Body size="S">
To customize your login button, fill out the fields below.