fixes: #29641

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
Erik Jan de Wit 2024-06-03 17:50:48 +02:00 committed by GitHub
parent 792a3457ff
commit a650d99b2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

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

View file

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