diff --git a/package.json b/package.json index 581b808..3697bc0 100755 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "keywords": [], "dependencies": { "evt": "^2.5.7", - "keycloakify": "^9.6.4", + "keycloakify": "^9.6.6", "oidc-spa": "^4.2.1", "powerhooks": "^1.0.8", "react": "^18.2.0", diff --git a/src/keycloak-theme/account/Template.tsx b/src/keycloak-theme/account/Template.tsx index 7f8236a..93e4e2f 100644 --- a/src/keycloak-theme/account/Template.tsx +++ b/src/keycloak-theme/account/Template.tsx @@ -25,7 +25,9 @@ export default function Template(props: TemplateProps) { `${url.resourcesPath}/css/account.css` ], "htmlClassName": getClassName("kcHtmlClass"), - "bodyClassName": clsx("admin-console", "user", getClassName("kcBodyClass")) + "bodyClassName": clsx("admin-console", "user", getClassName("kcBodyClass")), + "htmlLangProperty": locale?.currentLanguageTag, + "documentTitle": i18n.msgStr("accountManagementTitle") }); if (!isReady) { @@ -47,14 +49,12 @@ export default function Template(props: TemplateProps) { {realm.internationalizationEnabled && (assert(locale !== undefined), true) && locale.supported.length > 1 && (
  • - {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} {labelBySupportedLanguageTag[currentLanguageTag]}
      {locale.supported.map(({ languageTag }) => (
    • - {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} changeLocale(languageTag)}> {labelBySupportedLanguageTag[languageTag]} diff --git a/src/keycloak-theme/login/Template.tsx b/src/keycloak-theme/login/Template.tsx index cc05dbf..3ba0030 100644 --- a/src/keycloak-theme/login/Template.tsx +++ b/src/keycloak-theme/login/Template.tsx @@ -1,6 +1,6 @@ // Copy pasted from: https://github.com/InseeFrLab/keycloakify/blob/main/src/login/Template.tsx -import { useState, useEffect } from "react"; +import { useEffect } from "react"; import { assert } from "keycloakify/tools/assert"; import { clsx } from "keycloakify/tools/clsx"; import { usePrepareTemplate } from "keycloakify/lib/usePrepareTemplate"; @@ -42,11 +42,11 @@ export default function Template(props: TemplateProps) { `${url.resourcesPath}/css/login.css` ], "htmlClassName": getClassName("kcHtmlClass"), - "bodyClassName": getClassName("kcBodyClass") + "bodyClassName": getClassName("kcBodyClass"), + "htmlLangProperty": locale?.currentLanguageTag, + "documentTitle": i18n.msgStr("loginTitle", kcContext.realm.displayName) }); - useState(()=> { document.title = i18n.msgStr("loginTitle", kcContext.realm.displayName); }); - useEffect(() => { console.log(`Value of MY_ENV_VARIABLE on the Keycloak server: "${kcContext.properties.MY_ENV_VARIABLE}"`); }, []); diff --git a/yarn.lock b/yarn.lock index 446731a..d0b6d7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5407,10 +5407,10 @@ jwt-decode@^3.1.2: resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-3.1.2.tgz#3fb319f3675a2df0c2895c8f5e9fa4b67b04ed59" integrity sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A== -keycloakify@^9.6.4: - version "9.6.4" - resolved "https://registry.yarnpkg.com/keycloakify/-/keycloakify-9.6.4.tgz#5df6a960d084cd52b1501ba9e4ab46adf31fd41e" - integrity sha512-KIOr8GG624dfwlaOxkooTgq5pJgH94qXz3ee1sY38wsqE13BkxI1/SM7mLk/eKiaaTPGW0VANTk3PgJuWv5HGg== +keycloakify@^9.6.6: + version "9.6.6" + resolved "https://registry.yarnpkg.com/keycloakify/-/keycloakify-9.6.6.tgz#ecad120acf72d8b3d7faded9ddff9ee23b4f3139" + integrity sha512-G59FKXp1zbY1k5o5V2ldHl+SOcOOSt59hKsz2wS/RJEMENO8th4vPmLIP7L0rJyJaFfiFR9X/igaCMODKqpbQQ== dependencies: "@babel/generator" "^7.22.9" "@babel/parser" "^7.22.7"