Error on OpenIDConnect::saveUserinfo() when trying use account loaded by email

Created on 8 November 2023, 8 months ago

Problem/Motivation

When I'm trying to login, I receive this error:

The website encountered an unexpected error. Please try again later.
Error: Call to a member function id() on array in Drupal\openid_connect\OpenIDConnect->saveUserinfo() (line 696 of modules/contrib/openid_connect/src/OpenIDConnect.php).

Steps to reproduce

Proposed resolution

Current implementation:

$account_by_mail = $this->userStorage->loadByProperties(['mail' => $claim_value]);
if (empty($account_by_mail) || ($account_by_mail->id() == $account->id())) {

Proposed improvement (use current() in second if condition):

$account_by_mail = $this->userStorage->loadByProperties(['mail' => $claim_value]);
if (empty($account_by_mail) || (current($account_by_mail)->id() == $account->id())) {
πŸ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡΅πŸ‡±Poland gugalamaciek

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024