Pass totp.policy.getAlgorithmKey() to the freemarker template

This commit is contained in:
Joseph Garrone
2024-05-14 00:00:17 +02:00
parent 699a3c8bf6
commit 21454b9168
3 changed files with 13 additions and 9 deletions

View File

@ -254,6 +254,17 @@
<#attempt>
return "${url.getLogoutUrl()}";
<#recover>
throw new Error("Failed to invoke url.getLogoutUrl() in the FreeMarker template");
</#attempt>
};
</#if>
<#if pageId === "login-config-totp.ftl">
out["totp"]["policy"]["getAlgorithmKey"] = function () {
<#attempt>
return "${totp.policy.getAlgorithmKey()}";
<#recover>
throw new Error("Failed to invoke totp.policy.getAlgorithmKey() in the FreeMarker template");
</#attempt>
};
</#if>