diff --git a/src/lib/components/RegisterUserProfile.tsx b/src/lib/components/RegisterUserProfile.tsx index 8a450867..c88a6f87 100644 --- a/src/lib/components/RegisterUserProfile.tsx +++ b/src/lib/components/RegisterUserProfile.tsx @@ -68,6 +68,7 @@ export const RegisterUserProfile = memo(({ kcContext, ...props }: { kcContext: K id="password-confirm" className={cx(props.kcInputClass)} name="password-confirm" + autoComplete="new-password" aria-invalid={messagesPerField.existsError("password-confirm")} /> {messagesPerField.existsError("password-confirm") && ( @@ -141,18 +142,11 @@ const UserProfileFormFields = memo( return ( <> - {kcContext.profile.attributes.map((attribute, i) => { - const { group = "", groupDisplayHeader = "", groupDisplayDescription = "" } = attribute; - - console.log(JSON.stringify(attribute, null, 2)); - - //if (group === currentGroup) return null; - - currentGroup = group; - - return ( + {kcContext.profile.attributes + .map(attribute => [attribute, attribute]) + .map(([attribute, { group = "", groupDisplayHeader = "", groupDisplayDescription = "" }], i) => ( - {group !== "" && ( + {group !== currentGroup && (currentGroup = group) !== "" && (
- ); - })} + ))} ); }, diff --git a/src/lib/getKcContext/kcContextMocks/kcContextMocks.ts b/src/lib/getKcContext/kcContextMocks/kcContextMocks.ts index 59c81394..fdbae7ee 100644 --- a/src/lib/getKcContext/kcContextMocks/kcContextMocks.ts +++ b/src/lib/getKcContext/kcContextMocks/kcContextMocks.ts @@ -21,7 +21,7 @@ export const kcContextCommonMock: KcContextBase.Common = { "displayName": "myrealm", "displayNameHtml": "myrealm", "internationalizationEnabled": true, - "registrationEmailAsUsername": true, + "registrationEmailAsUsername": false, }, "messagesPerField": { "printIfExists": (...[, x]) => x, @@ -185,7 +185,6 @@ export const kcContextMocks: KcContextBase[] = [ id({ "pageId": "register-user-profile.ftl", ...registerCommon, - "profile": { "context": "REGISTRATION_PROFILE" as const, ...(() => {