Implement Error page
This commit is contained in:
@ -24,12 +24,17 @@ export const Error = memo((props: KcProps) => {
|
||||
displayMessage={false}
|
||||
headerNode={t("errorTitle")}
|
||||
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>
|
||||
</div>
|
||||
<div id="kc-error-message">
|
||||
<p className="instruction">{message.summary}</p>
|
||||
{
|
||||
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