The change made during this issue on 3.x is causing issues when calling getUserInfo() during an onUserLogin event.

https://www.drupal.org/project/social_auth_google/issues/3133754
https://www.drupal.org/commitlog/commit/88083/5fba18b753b85e5941db5d05dc...

When you call getUserInfo during a onUserLogin event and use the following code to retrieve user details:

$plugin_manager = $this->googleAuthManager;
$response = $plugin_manager->getUserInfo()->toArray();

Both $this->user and $this->getAccessToken() are both populated, which means

      $this->loggerFactory->get('social_auth_google')
        ->error('There was an error fetching the access token for user.');

Is called when $this->user is already populated, leading to my errors logs getting filled up a lot when there's no error here.

Patch to come. I've noticed this is already handled in the 4.x module:

https://git.drupalcode.org/project/social_auth_google/-/blob/4.0.x/src/G...

Comments

ThomWilhelm created an issue. See original summary.

thomwilhelm’s picture

thomwilhelm’s picture

Status: Active » Needs review
Related issues: +#3133754: 500 error on google auth
thomwilhelm’s picture

Title: Calling getUserInfo during a onUserLogin is broken » Calling getUserInfo during an onUserLogin event triggers an error
thomwilhelm’s picture

Issue summary: View changes