我使用 Keycloak 作为 React 应用程序的身份验证,并通过修改login.ftl
文件来自定义登录页面。根据 Keycloak 的文档,我正在将template.ftl
文件导入到我的文件中,并且一切正常。login.ftl
在 template.ftl 文件中,我可以像这样访问模板变量,
<#if displayMessage && message?has_content && (message.type != 'warning' || !isAppInitiatedAction??)>
<div class="alert alert-${message.type}">
<#if message.type = 'success'><span class="${properties.kcFeedbackSuccessIcon!}"></span></#if>
<#if message.type = 'warning'><span class="${properties.kcFeedbackWarningIcon!}"></span></#if>
<#if message.type = 'error'><span class="${properties.kcFeedbackErrorIcon!}"></span></#if>
<#if message.type = 'info'><span class="${properties.kcFeedbackInfoIcon!}"></span></#if>
<span class="kc-feedback-text">${kcSanitize(message.summary)?no_esc}</span>
</div>
</#if>
考虑到这一点,是否有一种方法可以访问template.ftl
orlogin.ftl
文件中的模板变量,该变量将提供会话刚刚结束或用户因为刚刚注销而被重定向到登录页面的信息?当用户在注销后被重定向到登录页面时,我想在template.ftl
或login.ftl
用户刚刚注销时显示消息 UI。