diff --git a/src/login/kcContext/KcContext.ts b/src/login/kcContext/KcContext.ts index 46802e03..c1ebbd60 100644 --- a/src/login/kcContext/KcContext.ts +++ b/src/login/kcContext/KcContext.ts @@ -201,6 +201,12 @@ export declare namespace KcContext { * A Keycloak Java extension used as dependency in Keycloakify. */ passwordPolicies?: PasswordPolicies; + url: { + registrationAction: string; + }; + passwordRequired: boolean; + recaptchaRequired: boolean; + recaptchaSiteKey?: string; }; export type RegisterUserProfile = Common & { @@ -215,15 +221,6 @@ export declare namespace KcContext { passwordRequired: boolean; recaptchaRequired: boolean; recaptchaSiteKey?: string; - social: { - displayInfo: boolean; - providers?: { - loginUrl: string; - alias: string; - providerId: string; - displayName: string; - }[]; - }; }; export type Info = Common & { diff --git a/src/login/pages/Register.tsx b/src/login/pages/Register.tsx index 316c9bce..d3a4c3c3 100644 --- a/src/login/pages/Register.tsx +++ b/src/login/pages/Register.tsx @@ -1,152 +1,45 @@ +import { useState } from "react"; import { clsx } from "keycloakify/tools/clsx"; import type { PageProps } from "keycloakify/login/pages/PageProps"; import { useGetClassName } from "keycloakify/login/lib/useGetClassName"; import type { KcContext } from "../kcContext"; import type { I18n } from "../i18n"; +import type { LazyOrNot } from "keycloakify/tools/LazyOrNot"; +import type { PropsOfUserProfileFormFields } from "keycloakify/login/UserProfileFormFields"; +import type { PropsOfTermsAcceptance } from "../TermsAcceptance"; -export default function Register(props: PageProps, I18n>) { - const { kcContext, i18n, doUseDefaultCss, Template, classes } = props; +type Props = PageProps, I18n> & { + UserProfileFormFields: LazyOrNot<(props: PropsOfUserProfileFormFields) => JSX.Element>; + TermsAcceptance: LazyOrNot<(props: PropsOfTermsAcceptance) => JSX.Element | null>; +}; + +export default function Register(props: Props) { + const { kcContext, i18n, doUseDefaultCss, Template, classes, UserProfileFormFields, TermsAcceptance } = props; const { getClassName } = useGetClassName({ doUseDefaultCss, classes }); - const { url, messagesPerField, register, realm, passwordRequired, recaptchaRequired, recaptchaSiteKey } = kcContext; + const { url, messagesPerField, recaptchaRequired, recaptchaSiteKey } = kcContext; const { msg, msgStr } = i18n; + const [isFormSubmittable, setIsFormSubmittable] = useState(false); + return (