From b5d500206191c5bbdacb56b64f28c5750264ddf0 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Tue, 9 Jul 2024 14:04:25 +0200 Subject: [PATCH] Mock kcContext.url.resourcePath for account v3 --- .../generateFtl/kcContextDeclarationTemplate.ftl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl b/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl index 418e9932..6efc3ab2 100644 --- a/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl +++ b/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl @@ -34,6 +34,14 @@ kcContext.pageId = "${pageId}"; if( kcContext.url && kcContext.url.resourcesPath ){ kcContext.url.resourcesCommonPath = kcContext.url.resourcesPath + "/" + "RESOURCES_COMMON_cLsLsMrtDkpVv"; } +if( kcContext.resourceUrl && !kcContext.url ){ + Object.defineProperty(kcContext, "url", { + value: { + resourcesPath: kcContext.resourceUrl + }, + enumerable: false + }); +} kcContext["x-keycloakify"] = {}; <#if profile?? && profile.attributes??> kcContext["x-keycloakify"].realmMessageBundleUserProfile = { @@ -428,6 +436,14 @@ function decodeHtmlEntities(htmlStr){ + <#if themeType == "account" && are_same_path(path, ["realm", "isInternationalizationEnabled"])> + <#attempt> + <#return realm.isInternationalizationEnabled()?c> + <#recover> + <#return "ABORT: Couldn't evaluate realm.isInternationalizationEnabled()"> + + + <#return "ABORT: It's a method">