diff --git a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl index 23f4f4769..5becdf625 100644 --- a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +++ b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl @@ -124,9 +124,11 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc}; ) || ( <#-- https://github.com/InseeFrLab/keycloakify/pull/65#issuecomment-991896344 (reports with saml-post-form.ftl) --> <#-- https://github.com/InseeFrLab/keycloakify/issues/91#issue-1212319466 (reports with error.ftl and Kc18) --> + <#-- https://github.com/InseeFrLab/keycloakify/issues/109#issuecomment-1134610163 --> key == "loginAction" && are_same_path(path, ["url"]) && - ["saml-post-form.ftl", "error.ftl"]?seq_contains(pageId) + ["saml-post-form.ftl", "error.ftl", "info.ftl"]?seq_contains(pageId) && + !(auth?has_content && auth.showTryAnotherWayLink()) ) || ( ["contextData", "idpConfig", "idp", "authenticationSession"]?seq_contains(key) && are_same_path(path, ["brokerContext"]) && @@ -152,6 +154,33 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc}; + + <#if key == "showUsername" && are_same_path(path, ["auth"])> + <#attempt> + <#return auth.showUsername()?c> + <#recover> + <#local out_seq += ["/*Couldn't evaluate auth.showUsername()*/"]> + <#continue> + + + + <#if key == "showResetCredentials" && are_same_path(path, ["auth"])> + <#attempt> + <#return auth.showResetCredentials()?c> + <#recover> + <#local out_seq += ["/*Couldn't evaluate auth.showResetCredentials()*/"]> + <#continue> + + + + <#if key == "showTryAnotherWayLink" && are_same_path(path, ["auth"])> + <#attempt> + <#return auth.showTryAnotherWayLink()?c> + <#recover> + <#local out_seq += ["/*Couldn't evaluate auth.showTryAnotherWayLink()*/"]> + <#continue> + + <#attempt> <#if !object[key]??> diff --git a/src/lib/getKcContext/KcContextBase.ts b/src/lib/getKcContext/KcContextBase.ts index ac977e005..e95a56bc7 100644 --- a/src/lib/getKcContext/KcContextBase.ts +++ b/src/lib/getKcContext/KcContextBase.ts @@ -52,9 +52,9 @@ export declare namespace KcContextBase { currentLanguageTag: KcLanguageTag; }; auth?: { - showUsername: boolean; - showResetCredentials: boolean; - showTryAnotherWayLink: boolean; + showUsername?: boolean; + showResetCredentials?: boolean; + showTryAnotherWayLink?: boolean; attemptedUsername?: string; }; scripts: string[];