Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register User Profile Page was removed in Keycloak 24 #533

Open
khanhprolazay opened this issue Apr 5, 2024 · 6 comments
Open

Register User Profile Page was removed in Keycloak 24 #533

khanhprolazay opened this issue Apr 5, 2024 · 6 comments

Comments

@khanhprolazay
Copy link

Hi keycloakify team,

Based on Keycloak 24 migration, They render custom attributes directly in the register page (and two another pages).
Screenshot from 2024-04-05 23-03-22

Therefore, they removed register user profile page.
Screenshot from 2024-04-05 23-08-55

You can read more detail via this link

When I add additional user attributes (phoneNumber), Keycloak 24 will render the register page, which in the theme, this page hasn't implemented the dynamic rendering mechanism yet.

When I use keycloak theme:
Screenshot from 2024-04-05 23-27-15

When I use theme build by Keycloakify:
Screenshot from 2024-04-05 23-30-00

Hope you find this well.

@garronej
Copy link
Collaborator

garronej commented Apr 8, 2024

Hello @khanhprolazay,
Yes thank you for reporting.
We're aware of this, it need to be addressed.
The challenging part is that this is a breaking change for every older Keycloak version.
Maybe we will have to provide different template for different target version.

In the meantime, remember that the components provided by Keycloakify can be overwrwiten. You don't need to use our components, you can freely modify or update them on your side.

Best.

@HeileneMartin
Copy link

Hello @garronej,

We're currently utilizing keycloakify-starter in our project and have encountered an issue similar to what @khanhprolazay has previously reported.

Our challenge lies in overriding the Register component. Here's what we've attempted so far:

We tried to add the UserProfileFormField component to our Register.tsx file. However, we ran into a problem where the context is asking for the 'profile' property, which seems to be part of the 'register-user-profile' context. Could you provide some guidance on how to correctly add this component?

We also attempted to create a custom field with the value {register.formData['user.attributes.phone']}. We're not sure if this is the correct approach, and would appreciate any advice you could give on this.

Here's an excerpt from our Register.tsx file for reference:

<input type="text" id="user.attributes.phone" name="user.attributes.phone" value={(register.formData['user.attributes.phone']!'')} />

Any assistance you could provide would be greatly appreciated.

Thank you in advance for your help.

@garronej
Copy link
Collaborator

garronej commented Apr 9, 2024

Hello @HeileneMartin,

It's in my top priority to work on this.

We tried to add the UserProfileFormField component to our Register.tsx file. However, we ran into a problem where the context is asking for the 'profile' property, which seems to be part of the 'register-user-profile' context. Could you provide some guidance on how to correctly add this component?

I think the profile should actually be on the kcContext, it's just that the type definition are not up to date. you can use kcContext as any or oveload the type definition in your kcContext.ts file.

@HeileneMartin
Copy link

HeileneMartin commented Apr 9, 2024

Hello @garronej

Thank you for your quick response to this. I've been trying to get this working for the last couple of days.

I've logged the kcContext to the console which showed my test field that I created in KeyCloak. The following code worked and recorded the input value I entered on submitting the form :

<div> <input type="text" id="test" name="test" value={ (register.formData as { [key: string]: string })[ 'user.attributes.test' ] } /> </div>

@garronej
Copy link
Collaborator

garronej commented Apr 9, 2024

@HeileneMartin I'm sorry you had to go through this.

I'm glad you where able to make it work.

@garronej
Copy link
Collaborator

Follow progress here: #538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants