web/user: fix post MFA creation link being invalid (#13157)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -13,6 +13,7 @@ export interface GlobalAuthentik {
|
|||||||
build: string;
|
build: string;
|
||||||
api: {
|
api: {
|
||||||
base: string;
|
base: string;
|
||||||
|
relBase: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,6 +28,7 @@ export function globalAK(): GlobalAuthentik {
|
|||||||
ak.brand = CurrentBrandFromJSON(ak.brand);
|
ak.brand = CurrentBrandFromJSON(ak.brand);
|
||||||
ak.config = ConfigFromJSON(ak.config);
|
ak.config = ConfigFromJSON(ak.config);
|
||||||
}
|
}
|
||||||
|
const apiBase = new URL(process.env.AK_API_BASE_PATH || window.location.origin);
|
||||||
if (!ak) {
|
if (!ak) {
|
||||||
return {
|
return {
|
||||||
config: ConfigFromJSON({
|
config: ConfigFromJSON({
|
||||||
@ -39,7 +41,8 @@ export function globalAK(): GlobalAuthentik {
|
|||||||
versionSubdomain: "",
|
versionSubdomain: "",
|
||||||
build: "",
|
build: "",
|
||||||
api: {
|
api: {
|
||||||
base: process.env.AK_API_BASE_PATH || window.location.origin,
|
base: apiBase.toString(),
|
||||||
|
relBase: apiBase.pathname,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ export class UserSettingsPassword extends AKElement {
|
|||||||
<div class="pf-c-card__body">
|
<div class="pf-c-card__body">
|
||||||
<a
|
<a
|
||||||
href="${ifDefined(this.configureUrl)}${AndNext(
|
href="${ifDefined(this.configureUrl)}${AndNext(
|
||||||
`${globalAK().api.base}if/user/#/settings;${JSON.stringify({ page: "page-details" })}`,
|
`${globalAK().api.relBase}if/user/#/settings;${JSON.stringify({ page: "page-details" })}`,
|
||||||
)}"
|
)}"
|
||||||
class="pf-c-button pf-m-primary"
|
class="pf-c-button pf-m-primary"
|
||||||
>
|
>
|
||||||
|
@ -74,7 +74,7 @@ export class MFADevicesPage extends Table<Device> {
|
|||||||
return html`<li>
|
return html`<li>
|
||||||
<a
|
<a
|
||||||
href="${ifDefined(stage.configureUrl)}${AndNext(
|
href="${ifDefined(stage.configureUrl)}${AndNext(
|
||||||
`${globalAK().api.base}if/user/#/settings;${JSON.stringify({
|
`${globalAK().api.relBase}if/user/#/settings;${JSON.stringify({
|
||||||
page: "page-mfa",
|
page: "page-mfa",
|
||||||
})}`,
|
})}`,
|
||||||
)}"
|
)}"
|
||||||
|
Reference in New Issue
Block a user