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

Redirection to registration form fails (e.g. when a profile field is required) with version 2 #6

Closed
benjaminfrombe opened this issue Sep 3, 2024 · 6 comments

Comments

@benjaminfrombe
Copy link

I would like to use linkedin authentication combined with the user filling in extra information while registering. Is this possible ?
e.g. When I try now adding a required field like "Role", I get a registration error ...

@luke-
Copy link
Contributor

luke- commented Sep 3, 2024

It should actually work like this.
If a required profile field is missing, it is explicitly prompted.

@luke-
Copy link
Contributor

luke- commented Sep 3, 2024

Can you test this with other AuthClients e.g. Google/GitHUb?

@benjaminfrombe
Copy link
Author

benjaminfrombe commented Sep 4, 2024

I have the same problem with Google OAuth ...

FYI, this is the profile field "Role" config:

image

@luke-
Copy link
Contributor

luke- commented Sep 4, 2024

Ok thanks for testing.

Can you please create an issue for this in the “humhub/humhub” repository. Seems to be a general AuthClient problem.

@marc-farre marc-farre changed the title required profile fields result in registration failed error Redirection to registration form fails (e.g. when a profile field is required) Oct 10, 2024
@marc-farre marc-farre changed the title Redirection to registration form fails (e.g. when a profile field is required) Redirection to registration form fails (e.g. when a profile field is required) with version 2 Oct 10, 2024
@marc-farre
Copy link
Contributor

@benjaminfrombe @luke- fixed in PR #8

The issue is when using v2 only (v1 doesn't work for me, maybe because of my recent LinkedIn auth app).

Error message:

Serialization of 'Closure' is not allowed

The issue was because of ArrayHelper::getValue() returning a Closure Object of LinkedinAuthV2, which was not serializable when writing the authClient to the session: https://github.com/humhub/humhub/blob/cb8e56c45051b6a7a179da07a3712fde0f9f5c81/protected/humhub/modules/user/controllers/AuthController.php#L242-L242

As a result, after redirecting to /user/registration the authClient from the session is empty: https://github.com/humhub/humhub/blob/cb8e56c45051b6a7a179da07a3712fde0f9f5c81/protected/humhub/modules/user/controllers/RegistrationController.php#L91-L91

I haven't tested other clients (such as Google), but they don't use ArrayHelper::getValue(), so if Google doesn't work either, it must be a different issue. But it is not a general AuthClient problem.

@luke- luke- closed this as completed in 6ffa398 Oct 11, 2024
luke- added a commit that referenced this issue Oct 11, 2024
…ails

Fix #6: Redirection to registration form fails (e.g. when a profile f…
@luke-
Copy link
Contributor

luke- commented Oct 11, 2024

@marc-farre Thanks!

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