web/user: fix post MFA creation link being invalid (#13157)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L.
2025-02-21 16:43:01 +01:00
committed by GitHub
parent 6da0548fa2
commit d98523f243
3 changed files with 6 additions and 3 deletions

View File

@ -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,
},
};
}