fix: enforce lowercase email addresses
This commit is contained in:
@@ -142,7 +142,7 @@ class UserDataHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
$users = $repository->findBy([
|
$users = $repository->findBy([
|
||||||
'email' => $email,
|
'email' => mb_strtolower(trim($email)),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (1 !== count($users)) {
|
if (1 !== count($users)) {
|
||||||
|
|||||||
+1
-1
@@ -184,7 +184,7 @@ class User implements UserInterface, TimestampableEntityInterface, SoftDeletable
|
|||||||
|
|
||||||
public function setEmail(string $email): static
|
public function setEmail(string $email): static
|
||||||
{
|
{
|
||||||
$this->email = $email;
|
$this->email = mb_strtolower(trim($email));
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ class MyEpAuthenticator extends AbstractAuthenticator
|
|||||||
|
|
||||||
$addressId = $userinfo['address_id'] ?? null;
|
$addressId = $userinfo['address_id'] ?? null;
|
||||||
$personId = $userinfo['person_id'] ?? null;
|
$personId = $userinfo['person_id'] ?? null;
|
||||||
|
$email = mb_strtolower(trim($userinfo['email']));
|
||||||
|
|
||||||
if (null !== $addressId && null !== $personId) {
|
if (null !== $addressId && null !== $personId) {
|
||||||
$user = $repository->findOneBy([
|
$user = $repository->findOneBy([
|
||||||
@@ -267,12 +268,12 @@ class MyEpAuthenticator extends AbstractAuthenticator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$users = $repository->findBy(['email' => $userinfo['email']]);
|
$users = $repository->findBy(['email' => $email]);
|
||||||
|
|
||||||
if (1 !== count($users)) {
|
if (1 !== count($users)) {
|
||||||
if (1 < count($users)) {
|
if (1 < count($users)) {
|
||||||
$this->logger->warning('Unable to match local user by email: multiple users found', [
|
$this->logger->warning('Unable to match local user by email: multiple users found', [
|
||||||
'email' => $userinfo['email'],
|
'email' => $email,
|
||||||
'count' => count($users),
|
'count' => count($users),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user