Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
web/user: fix post MFA creation link being invalid
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
  • Loading branch information
BeryJu committed Feb 21, 2025
commit ce5467f77c105f644aa37772cb57f8caa1470b4d
5 changes: 4 additions & 1 deletion web/src/common/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface GlobalAuthentik {
build: string;
api: {
base: string;
relBase: string;
};
}

Expand All @@ -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({
Expand All @@ -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,
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion web/src/user/user-settings/details/UserPassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class UserSettingsPassword extends AKElement {
<div class="pf-c-card__body">
<a
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"
>
Expand Down
2 changes: 1 addition & 1 deletion web/src/user/user-settings/mfa/MFADevicesPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class MFADevicesPage extends Table<Device> {
return html`<li>
<a
href="${ifDefined(stage.configureUrl)}${AndNext(
`${globalAK().api.base}if/user/#/settings;${JSON.stringify({
`${globalAK().api.relBase}if/user/#/settings;${JSON.stringify({
page: "page-mfa",
})}`,
)}"
Expand Down
Loading