diff --git a/src/keycloak-theme/login/kcContext.ts b/src/keycloak-theme/login/kcContext.ts index 53ea538..7037322 100644 --- a/src/keycloak-theme/login/kcContext.ts +++ b/src/keycloak-theme/login/kcContext.ts @@ -78,9 +78,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" @@ -101,4 +101,4 @@ export const { kcContext } = getKcContext({ }); -export type KcContext = NonNullable["kcContext"]>; \ No newline at end of file +export type KcContext = NonNullable["kcContext"]>;