Generate kcContext automatically 🚀

This commit is contained in:
garronej
2021-06-22 12:37:21 +02:00
parent 0dacf2fe30
commit 2cd266caff
14 changed files with 190 additions and 934 deletions

View File

@ -9,6 +9,13 @@ import ReactMarkdown from "react-markdown";
export type MessageKey = keyof typeof kcMessages["en"];
/**
* When the language is switched the page is reloaded, this may appear
* as a bug as you might notice that the language successfully switch before
* reload.
* However we need to tell Keycloak that the user have changed the language
* during login so we can retrieve the "local" field of the JWT encoded accessToken.
*/
export function useKcMessage() {
const { kcLanguageTag } = useKcLanguageTag();