Enable possiblity to support custom pages (without forking keycloakify)

This commit is contained in:
garronej
2021-06-23 18:03:49 +02:00
parent e3b41c9bd1
commit c9b2db625c
7 changed files with 16 additions and 21 deletions

View File

@ -5,14 +5,14 @@ import { ftlValuesGlobalName } from "../../bin/build-keycloak-theme/ftlValuesGlo
export function getKcContext<KcContextExtended extends { pageId: string; } = never>(
params?: {
mockPageId: KcContextBase["pageId"] | KcContextExtended["pageId"] | false;
mockPageId?: KcContextBase["pageId"] | KcContextExtended["pageId"];
kcContextExtendedMock?: KcContextExtended[];
}
): { kcContext: KcContextBase | KcContextExtended & KcContextBase.Common; } {
): { kcContext: (KcContextBase | KcContextExtended & KcContextBase.Common) | undefined; } {
const { mockPageId, kcContextExtendedMock } = params ?? { "mockPageId": false };
if (typeof mockPageId === "string") {
if (mockPageId !== undefined) {
return {
"pageId": mockPageId,