Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openy 163 Resolved Virtual Y: With Y-USA Provider, members with same first name and last name cannot authenticate with barcode #402

Merged
merged 10 commits into from
Dec 7, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,20 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
$name = $result['FirstName'] . ' ' . $result['LastName'];
$email = $result['Email'];
}
// 4. Case when user name already exist in the site.
$users = $this->entityTypeManager
->getStorage('user')
->loadByProperties(['name' => $name]);
$user = reset($users);
if ($user) {
if (in_array($provider_config->get('verification_type'),
['barcode',
'membership_id',
])) {
$name = 'y-usa+' . $id;
$email = $result['Email'];
}
}
if (!empty($name) && !empty($email)) {
// Check if user already created.
$users = $this->entityTypeManager
Expand Down