Revert "revert pr #29932 (#29956)"

This reverts commit a650d99b2f.
This commit is contained in:
Hynek Mlnařík 2024-06-04 09:07:55 +02:00
parent 193439788e
commit e5123ea9de
2 changed files with 3 additions and 10 deletions

View file

@ -1,8 +1,4 @@
import {
AccountEnvironment,
KeycloakProvider,
environment,
} from "@keycloak/keycloak-ui-shared";
import { KeycloakProvider, environment } from "@keycloak/keycloak-ui-shared";
import { Page, Spinner } from "@patternfly/react-core";
import { Suspense } from "react";
import { Outlet } from "react-router-dom";
@ -11,7 +7,7 @@ import { PageNav } from "./PageNav";
export const Root = () => {
return (
<KeycloakProvider environment={environment as AccountEnvironment}>
<KeycloakProvider environment={environment}>
<Page header={<Header />} sidebar={<PageNav />} isManagedSidebar>
<Suspense fallback={<Spinner />}>
<Outlet />

View file

@ -49,10 +49,7 @@ export const KeycloakProvider = <T extends BaseEnvironment>({
const [error, setError] = useState<unknown>();
const keycloak = useMemo(() => {
const keycloak = new Keycloak({
url:
"authServerUrl" in environment
? (environment.authServerUrl as string)
: environment.authUrl,
url: environment.authUrl,
realm: environment.realm,
clientId: environment.clientId,
});