Code of the hook is incorrect and second condition contradicts the comment.
This issue is still present in the 8.x-1.x branch

Current code:

  if (!empty($oidc_name) && (strpos($name, 'oidc_') === 0 || strpos($name, '@'))) {
    $name = $oidc_name;
  }

Should be:

  if (!empty($oidc_name) && !(strpos($name, 'oidc_') === 0 || strpos($name, '@'))) {
    $name = $oidc_name;
  }

The difference is with second part of condition should have an exclamation mark in front of it. The logic is that condition should be applied once both parts of IF statement condition are true. If either of the conditions within parenthesis (second main condition) is true, then it should not be applied. If both are false, then name should be overridden.

CommentFileSizeAuthor
#4 3117414-13488246.patch668 bytespjotr.savitski

Comments

pjotr.savitski created an issue. See original summary.

pjotr.savitski’s picture

Issue summary: View changes
pjotr.savitski’s picture

This patch should do the trick

pjotr.savitski’s picture

StatusFileSize
new668 bytes
pjotr.savitski’s picture

Status: Active » Needs review
jcnventura’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

  • jcnventura authored d548612 on 8.x-1.x
    Issue #3117414 by pjotr.savitski, jcnventura:...
jcnventura’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.