changed to use serverBaseUrl instead (#32412)

fixes: #32205

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
Erik Jan de Wit 2024-09-09 21:40:26 +02:00 committed by GitHub
parent ccb166d0e9
commit 760b1d2a4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,8 +6,10 @@ import {
import {
FormErrorText,
HelpItem,
KeycloakSpinner,
SelectControl,
TextControl,
useEnvironment,
useFetch,
} from "@keycloak/keycloak-ui-shared";
import {
@ -26,16 +28,14 @@ import { FormattedLink } from "../components/external-link/FormattedLink";
import { FixedButtonsGroup } from "../components/form/FixedButtonGroup";
import { FormAccess } from "../components/form/FormAccess";
import { KeyValueInput } from "../components/key-value-form/KeyValueInput";
import { KeycloakSpinner } from "@keycloak/keycloak-ui-shared";
import { useRealm } from "../context/realm-context/RealmContext";
import {
addTrailingSlash,
convertAttributeNameToForm,
convertToFormValues,
} from "../util";
import { UIRealmRepresentation } from "./RealmSettingsTabs";
import useIsFeatureEnabled, { Feature } from "../utils/useIsFeatureEnabled";
import { UIRealmRepresentation } from "./RealmSettingsTabs";
type RealmSettingsGeneralTabProps = {
realm: UIRealmRepresentation;
@ -95,7 +95,9 @@ function RealmSettingsGeneralTabForm({
save,
userProfileConfig,
}: RealmSettingsGeneralTabFormProps) {
const { adminClient } = useAdminClient();
const {
environment: { serverBaseUrl },
} = useEnvironment();
const { t } = useTranslation();
const { realm: realmName } = useRealm();
@ -250,7 +252,7 @@ function RealmSettingsGeneralTabForm({
<StackItem>
<FormattedLink
href={`${addTrailingSlash(
adminClient.baseUrl,
serverBaseUrl,
)}realms/${realmName}/.well-known/openid-configuration`}
title={t("openIDEndpointConfiguration")}
/>
@ -258,7 +260,7 @@ function RealmSettingsGeneralTabForm({
<StackItem>
<FormattedLink
href={`${addTrailingSlash(
adminClient.baseUrl,
serverBaseUrl,
)}realms/${realmName}/protocol/saml/descriptor`}
title={t("samlIdentityProviderMetadata")}
/>