问题描述
我正在使用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
或login.ftl
文件中的模板变量,该变量将提供有关会话刚刚结束或用户已重定向到登录页面的信息。因为他们刚登出?当用户注销后重定向到登录页面时,我想在template.ftl
或login.ftl
中显示用户刚刚注销的消息UI。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)