Implement register

This commit is contained in:
Joseph Garrone
2021-03-04 18:15:48 +01:00
parent 09c7b6ac03
commit 2ee12abc43
9 changed files with 363 additions and 14 deletions

View File

@ -2,7 +2,7 @@
import { ftlValuesGlobalName } from "../bin/build-keycloak-theme/ftlValuesGlobalName";
import type { generateFtlFilesCodeFactory } from "../bin/build-keycloak-theme/generateFtl";
import { id } from "evt/tools/typeSafety/id";
import type { KcLanguageTag } from "./i18n/KcLanguageTag";
import type { KcLanguageTag } from "./i18n/KcLanguageTag";
export type KcContext = {
@ -14,6 +14,9 @@ export type KcContext = {
loginRestartFlowUrl: string;
loginResetCredentialsUrl: string;
registrationUrl: string;
//Specific to register
registrationAction: string;
loginUrl: string;
};
realm: {
displayName?: string;
@ -67,6 +70,32 @@ export type KcContext = {
rememberMe: boolean;
};
registrationDisabled: boolean;
//Specific to register
messagesPerField: {
printIfExists<T>(
key:
"userLabel" |
"username" |
"email" |
"firstName" |
"lastName" |
"password" |
"password-confirm",
x: T
): T | undefined;
};
register: {
formData: {
firstName?: string;
displayName?: string;
lastName?: string;
email?: string;
username?: string;
}
};
passwordRequired: boolean;
recaptchaRequired: boolean;
recaptchaSiteKey: string;
};
export const kcContext = id<KcContext | undefined>((window as any)[ftlValuesGlobalName]);