diff --git a/src/App/App.tsx b/src/App/App.tsx index 08b165f..2ea3624 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -19,7 +19,7 @@ const { OidcClientProvider } = createOidcClientProvider({ //Instead of foo and bar you could have isDark for example or any other state that you wish to //transfer from the main app to the login pages. .map(url => addFooToQueryParams({ url, value: { foo: 42 } })) - .map(url => addBarToQueryParams({ url, "value": "value of bar transferred to login page" })) + .map(url => addBarToQueryParams({ url, value: "value of bar transferred to login page" })) [0], // An event emitter that posts whenever the user interacts with the app // This is to tell if we should allow the token to expires. diff --git a/src/App/oidc.tsx b/src/App/oidc.tsx index 036437e..991dfae 100644 --- a/src/App/oidc.tsx +++ b/src/App/oidc.tsx @@ -58,12 +58,12 @@ async function createKeycloakOidcClient(params: Params): Promise { const isAuthenticated = await keycloakInstance .init({ - "onLoad": "check-sso", - "silentCheckSsoRedirectUri": `${window.location.origin}/silent-sso.html`, - "responseMode": "query", - "checkLoginIframe": false, - "adapter": createKeycloakAdapter({ - "transformUrlBeforeRedirect": url => + onLoad: "check-sso", + silentCheckSsoRedirectUri: `${window.location.origin}/silent-sso.html`, + responseMode: "query", + checkLoginIframe: false, + adapter: createKeycloakAdapter({ + transformUrlBeforeRedirect: url => [url].map(transformUrlBeforeRedirect).map( url => addParamToUrl({ @@ -73,7 +73,7 @@ async function createKeycloakOidcClient(params: Params): Promise { }).newUrl )[0], keycloakInstance, - "getRedirectMethod": () => redirectMethod + getRedirectMethod: () => redirectMethod }) }) .catch((error: Error) => error);