diff --git a/README.md b/README.md index 4683125..489ed7c 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ First, setup: yarn ``` -Then, start a Keycloak, create a public OIDC client with `http://localhost:3000` Root URL, and update the `public/keycloak.json` file with the client config. +Then, start a Keycloak server (use hosted [Phase Two](https://phasetwo.io/dashboard/) for easy testing), create a public OIDC client with `http://localhost:3000` Root URL, and update the `public/keycloak.json` file with the client config. Finally, run the development server: @@ -96,7 +96,7 @@ Finally, run the development server: yarn start ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +You mill most likely need to use the fully qualified portal url [http://localhost:3000/auth/realms/master/portal](http://localhost:3000/auth/realms/master/portal). ### Build the extension diff --git a/ext/main/java/io/phasetwo/portal/PortalResourceProvider.java b/ext/main/java/io/phasetwo/portal/PortalResourceProvider.java index a5c5607..f7dc7e8 100644 --- a/ext/main/java/io/phasetwo/portal/PortalResourceProvider.java +++ b/ext/main/java/io/phasetwo/portal/PortalResourceProvider.java @@ -256,13 +256,15 @@ public Response portal() { Optional.ofNullable(realm.getAttribute("_providerConfig.assets.favicon.url")) .orElse( String.format( - "%s/realms/%s/portal/favicon.ico", authUrlAttribute, realmName))) + "%s/realms/%s/portal/favicon.ico", + authUrlAttribute, realm.getName()))) .setAttribute( "appiconUrl", Optional.ofNullable(realm.getAttribute("_providerConfig.assets.appicon.url")) .orElse( String.format( - "%s/realms/%s/portal/logo192.png", authUrlAttribute, realmName))) + "%s/realms/%s/portal/logo192.png", + authUrlAttribute, realm.getName()))) .setAttribute("displayName", realmName) .setAttribute("realmName", realm.getName()); FreeMarkerLoginFormsProvider fm = (FreeMarkerLoginFormsProvider) form; diff --git a/src/components/utils/injectStyles.tsx b/src/components/utils/injectStyles.tsx index 826db31..89b2580 100644 --- a/src/components/utils/injectStyles.tsx +++ b/src/components/utils/injectStyles.tsx @@ -31,14 +31,17 @@ const InjectStyles = () => { const customStyles = ` ${primaryColor} ${secondaryColor} - ${styles.customCSS} + ${styles.customCSS || ""} ` .replace(/\r?\n/g, " ") .replace(/\s+/g, " ") .trim(); styleElement.innerHTML = customStyles; - document.body.appendChild(styleElement); + + if (customStyles) { + document.body.appendChild(styleElement); + } return () => { document.body.removeChild(styleElement); diff --git a/src/pages/organizations/settings/index.tsx b/src/pages/organizations/settings/index.tsx index d9ba755..1e86691 100644 --- a/src/pages/organizations/settings/index.tsx +++ b/src/pages/organizations/settings/index.tsx @@ -40,7 +40,9 @@ export default function OrganizationSettings() { items={[ { title: t("organizations"), link: `/organizations` }, { - title: `${org?.displayName || t("organization")}`.trim(), + title: `${ + org?.displayName || org?.name || t("organization") + }`.trim(), link: `/organizations/${orgId}/details`, }, ]}