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.
Comments
Comment #2
pjotr.savitski commentedComment #3
pjotr.savitski commentedThis patch should do the trick
Comment #4
pjotr.savitski commentedComment #5
pjotr.savitski commentedComment #6
jcnventuraLooks good!
Comment #8
jcnventura