From be73ff2c32b855cea6afe5ada625392413b696f6 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 5 Aug 2021 14:36:10 +0100 Subject: [PATCH] Fixing an issue with OIDC URL for preauth. --- .../src/pages/builder/auth/_components/OIDCButton.svelte | 7 +++++-- packages/worker/src/api/routes/global/auth.js | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte b/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte index 24aca0c396..bae68b6548 100644 --- a/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte +++ b/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte @@ -6,7 +6,7 @@ import OktaLogo from "assets/okta-logo.png" import OneLoginLogo from "assets/onelogin-logo.png" - import { oidc, organisation } from "stores/portal" + import { oidc, organisation, auth } from "stores/portal" import { onMount } from "svelte" $: show = $organisation.oidc @@ -31,7 +31,10 @@ {#if show} - window.open(`/api/global/auth/oidc/configs/${$oidc.uuid}`, "_blank")} + window.open( + `/api/global/auth/${$auth.tenantId}/oidc/configs/${$oidc.uuid}`, + "_blank" + )} >
oidc icon diff --git a/packages/worker/src/api/routes/global/auth.js b/packages/worker/src/api/routes/global/auth.js index f85d08057b..5e39f79135 100644 --- a/packages/worker/src/api/routes/global/auth.js +++ b/packages/worker/src/api/routes/global/auth.js @@ -30,7 +30,9 @@ function buildResetUpdateValidation() { } function updateTenant(ctx, next) { - updateTenantId(ctx.params.tenantId) + if (ctx.params) { + updateTenantId(ctx.params.tenantId) + } return next() }