From 5d391424f7ccb4cc4a57db394f82510a67b765c4 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 17:01:09 +0100 Subject: [PATCH] web/user: fix post MFA creation link being invalid (cherry-pick #13157) (#13159) web/user: fix post MFA creation link being invalid (#13157) Signed-off-by: Jens Langhammer Co-authored-by: Jens L. --- web/src/common/global.ts | 5 ++++- web/src/user/user-settings/details/UserPassword.ts | 2 +- web/src/user/user-settings/mfa/MFADevicesPage.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/src/common/global.ts b/web/src/common/global.ts index 7e6046def2..8b29b8150f 100644 --- a/web/src/common/global.ts +++ b/web/src/common/global.ts @@ -13,6 +13,7 @@ export interface GlobalAuthentik { build: string; api: { base: string; + relBase: string; }; } @@ -27,6 +28,7 @@ export function globalAK(): GlobalAuthentik { ak.brand = CurrentBrandFromJSON(ak.brand); ak.config = ConfigFromJSON(ak.config); } + const apiBase = new URL(process.env.AK_API_BASE_PATH || window.location.origin); if (!ak) { return { config: ConfigFromJSON({ @@ -39,7 +41,8 @@ export function globalAK(): GlobalAuthentik { versionSubdomain: "", build: "", api: { - base: process.env.AK_API_BASE_PATH || window.location.origin, + base: apiBase.toString(), + relBase: apiBase.pathname, }, }; } diff --git a/web/src/user/user-settings/details/UserPassword.ts b/web/src/user/user-settings/details/UserPassword.ts index 2d93f449ec..1a971116dc 100644 --- a/web/src/user/user-settings/details/UserPassword.ts +++ b/web/src/user/user-settings/details/UserPassword.ts @@ -32,7 +32,7 @@ export class UserSettingsPassword extends AKElement {