concretecms: TypeError on Login with Google

Affected Version of Concrete CMS

9.x

Description

I’ve got this error

TypeError
Concrete\Core\Authentication\Type\OAuth\ServiceProvider::handle(): Return value must be of type Symfony\Component\HttpFoundation\Response, string returned

How to reproduce

Enable Google authentication and try to sign in with Google

I’ll update more detail

Possible Solution

@mlocati Updated Authentication\Type\OAuth\ServiceProvider and created a handle method that should return Response object.

https://github.com/concretecms/concretecms/commit/fc05e01cf93842033b97c2f1126a1c9a2e66360b

However, methods that are called from handle method don’t return Response object.

https://github.com/concretecms/concretecms/blob/2f4c85a6eaa88e91a167c60e9254a2244ee1dab6/concrete/src/Authentication/Type/OAuth/OAuth2/GenericOauth2TypeController.php#L99-L137

We should remove type hint from handle method or fix all callback methods to return Response object.

I don’t know which is better

Additional Context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (16 by maintainers)

Most upvoted comments

@yukimacareux thank you for the detailed analysis, very helpful!

Do you have user attributes with these options turned on?

required-attr

If so, #12275 should fix the problem.

@mlocati Hello. It’s Yuki from MACAREUX DIGITAL, INC.

This issue happens when first time a user login to CMS with a Google account and the user account is not on CMS.

スクリーンショット 2024-10-23 13 22 35

.mov file: https://github.com/user-attachments/assets/d463055d-08dd-406d-b7ce-94183300ad86

However the user account is created after the login with a Google account. スクリーンショット 2024-10-23 13 27 45