Skip to content

Commit

Permalink
Merge pull request #14 from madroneropaulo/patch-1
Browse files Browse the repository at this point in the history
Update kcContext.ts
  • Loading branch information
garronej committed Apr 19, 2024
2 parents 4da6993 + 18d122e commit 5b2cdcb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/keycloak-theme/login/kcContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ export const { getKcContext } = createGetKcContext<KcContextExtension>({
"*.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: <T>(fieldName: string, className: T) => { console.log({ fieldName }); return fieldName === "email" ? className : undefined; },
printIfExists: <T>(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"
Expand All @@ -101,4 +101,4 @@ export const { kcContext } = getKcContext({
});


export type KcContext = NonNullable<ReturnType<typeof getKcContext>["kcContext"]>;
export type KcContext = NonNullable<ReturnType<typeof getKcContext>["kcContext"]>;

0 comments on commit 5b2cdcb

Please sign in to comment.