diff --git a/package.json b/package.json index 84ac544..137c365 100755 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "evt": "^2.4.15", "jwt-decode": "^3.1.2", "keycloak-js": "^21.0.1", - "keycloakify": "^7.9.2", + "keycloakify": "^7.9.4", "powerhooks": "^0.26.8", "react": "18.1.0", "react-dom": "18.1.0", diff --git a/src/App/App.tsx b/src/App/App.tsx index 86d26ba..b6146dc 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -51,13 +51,20 @@ function ContextualizedApp() { value: "en" }).newUrl; - // Enable to redirect to the app from the account page we'll get kcContext.url.referrerURI + // Enable to redirect to the app from the account page we'll get the referrer_uri under kcContext.referrer.url + // It's useful to avoid hard coding the app url in the keycloak config accountUrl = addParamToUrl({ url: accountUrl, name: "referrer", value: keycloakClient }).newUrl; + accountUrl = addParamToUrl({ + url: accountUrl, + name: "referrer_uri", + value: window.location.href + }).newUrl; + return (
{JSON.stringify(jwt_decode(oidcClient.getAccessToken()), null, 2)}
>
@@ -78,7 +85,7 @@ function ContextualizedApp() {
Hello world
-Check out all keycloak pages in the Storybook!
+Check out all keycloak pages in the Storybook!
Once you've identified the ones you want to customize run npx eject-keycloak-page