From 18d122e1e72e88c254b9abe25c7525cdda2e1ca5 Mon Sep 17 00:00:00 2001 From: Paulo Date: Sat, 9 Dec 2023 14:32:55 -0500 Subject: [PATCH] Update kcContext.ts Fix param according to description here https://github.com/keycloakify/keycloakify/blob/0a0f90aa2e466cf359e9946d89eebe78becfa1b1/src/account/kcContext/KcContext.ts#L64 --- src/keycloak-theme/login/kcContext.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/keycloak-theme/login/kcContext.ts b/src/keycloak-theme/login/kcContext.ts index e636898..42df914 100644 --- a/src/keycloak-theme/login/kcContext.ts +++ b/src/keycloak-theme/login/kcContext.ts @@ -79,9 +79,9 @@ export const { getKcContext } = createGetKcContext({ "*.example.com", "hello-world.com" ], - // Simulate we got an error with the email field + // Simulate we got an error with the email field. Return text if message for given field exists. messagesPerField: { - printIfExists: (fieldName: string, className: T) => { console.log({ fieldName }); return fieldName === "email" ? className : undefined; }, + printIfExists: (fieldName: string, text: T) => { console.log({ fieldName }); return fieldName === "email" ? text : undefined; }, existsError: (fieldName: string) => fieldName === "email", get: (fieldName: string) => `Fake error for ${fieldName}`, exists: (fieldName: string) => fieldName === "email" @@ -97,4 +97,4 @@ export const { kcContext } = getKcContext({ }); -export type KcContext = NonNullable["kcContext"]>; \ No newline at end of file +export type KcContext = NonNullable["kcContext"]>;