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"]>;