Implement Error page
This commit is contained in:
@ -1,4 +1,15 @@
|
||||
<script>const _=
|
||||
{
|
||||
"client": (function (){
|
||||
|
||||
<#if client??>
|
||||
return {
|
||||
"baseUrl": "${(client.baseUrl!'')?no_esc}" || undefined
|
||||
};
|
||||
</#if>
|
||||
|
||||
return undefined;
|
||||
|
||||
})()
|
||||
}
|
||||
</script>
|
@ -31,7 +31,7 @@
|
||||
"pageRedirectUri": "${(pageRedirectUri!'')?no_esc}" || undefined,
|
||||
"actionUri": "${(actionUri!'')?no_esc}" || undefined,
|
||||
"client": {
|
||||
"baseUrl": "${(actionUri!'')?no_esc}" || undefined
|
||||
"baseUrl": "${(client.baseUrl!'')?no_esc}" || undefined
|
||||
}
|
||||
}
|
||||
</script>
|
@ -7,6 +7,7 @@
|
||||
"realm": {
|
||||
"loginWithEmailAllowed": ${realm.loginWithEmailAllowed?c},
|
||||
"rememberMe": ${realm.rememberMe?c},
|
||||
"password": ${realm.password?c},
|
||||
"resetPasswordAllowed": ${realm.resetPasswordAllowed?c},
|
||||
"registrationAllowed": ${realm.registrationAllowed?c}
|
||||
},
|
||||
|
@ -11,7 +11,6 @@
|
||||
"displayName": "${realm.displayName!''}" || undefined,
|
||||
"displayNameHtml": "${realm.displayNameHtml!''}" || undefined,
|
||||
"internationalizationEnabled": ${realm.internationalizationEnabled?c},
|
||||
"password": ${realm.password?c},
|
||||
"registrationEmailAsUsername": ${realm.registrationEmailAsUsername?c},
|
||||
},
|
||||
"locale": (function (){
|
||||
|
@ -26,9 +26,14 @@ export const Error = memo((props: KcProps) => {
|
||||
formNode={
|
||||
<div id="kc-error-message">
|
||||
<p className="instruction">{message.summary}</p>
|
||||
<#if client?? && client.baseUrl?has_content>
|
||||
<p><a id="backToApplication" href="${client.baseUrl}">${kcSanitize(msg("backToApplication"))?no_esc}</a></p>
|
||||
</#if>
|
||||
{
|
||||
client !== undefined && client.baseUrl !== undefined &&
|
||||
<p>
|
||||
<a id="backToApplication" href={client.baseUrl}>
|
||||
{t("backToApplication")}
|
||||
</a>
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
|
@ -6,6 +6,7 @@ import type { KcProps } from "./KcProps";
|
||||
import { Login } from "./Login";
|
||||
import { Register } from "./Register";
|
||||
import { Info } from "./Info";
|
||||
import { Error } from "./Error";
|
||||
|
||||
|
||||
export const KcApp = memo((props: KcProps) => {
|
||||
@ -16,6 +17,7 @@ export const KcApp = memo((props: KcProps) => {
|
||||
case "login.ftl": return <Login {...props} />;
|
||||
case "register.ftl": return <Register {...props} />;
|
||||
case "info.ftl": return <Info {...props} />;
|
||||
case "error.ftl": return <Error {...props} />;
|
||||
}
|
||||
|
||||
});
|
@ -25,8 +25,7 @@ export declare namespace KcContext {
|
||||
displayName?: string;
|
||||
displayNameHtml?: string;
|
||||
internationalizationEnabled: boolean;
|
||||
password: boolean;
|
||||
registrationEmailAsUsername: boolean;
|
||||
registrationEmailAsUsername: boolean; //<---
|
||||
};
|
||||
/** Undefined if !realm.internationalizationEnabled */
|
||||
locale?: {
|
||||
@ -63,6 +62,7 @@ export declare namespace KcContext {
|
||||
realm: {
|
||||
loginWithEmailAllowed: boolean;
|
||||
rememberMe: boolean;
|
||||
password: boolean;
|
||||
resetPasswordAllowed: boolean;
|
||||
registrationAllowed: boolean;
|
||||
};
|
||||
@ -132,7 +132,10 @@ export declare namespace KcContext {
|
||||
};
|
||||
|
||||
export type Error = Template & {
|
||||
pageId: "error.ftl"
|
||||
pageId: "error.ftl";
|
||||
client?: {
|
||||
baseUrl?: string;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user