Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed May 23, 2022
1 parent f5231b8 commit 9de0083
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
Expand Up @@ -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"]) &&
Expand All @@ -152,6 +154,33 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc};
</#attempt>
</#if>
<#if key == "showUsername" && are_same_path(path, ["auth"])>
<#attempt>
<#return auth.showUsername()?c>
<#recover>
<#local out_seq += ["/*Couldn't evaluate auth.showUsername()*/"]>
<#continue>
</#attempt>
</#if>
<#if key == "showResetCredentials" && are_same_path(path, ["auth"])>
<#attempt>
<#return auth.showResetCredentials()?c>
<#recover>
<#local out_seq += ["/*Couldn't evaluate auth.showResetCredentials()*/"]>
<#continue>
</#attempt>
</#if>
<#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>
<#attempt>
<#if !object[key]??>
Expand Down
6 changes: 3 additions & 3 deletions src/lib/getKcContext/KcContextBase.ts
Expand Up @@ -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[];
Expand Down

0 comments on commit 9de0083

Please sign in to comment.