feat: normalize email addresses to lowercase on write

This commit is contained in:
fromme committed 2026-09-21 12:20:55 +02:00
1 parent d6327f033e
commit af46c57bd1
7 files changed
+102 -4

No files matched your search

+3 -1
View File
@@ -39,7 +39,9 @@ class Communication
public function setEmail(?string $email): static
{
$this->email = $email;
// BusPro compares addresses case-insensitively; normalize on the way in so the DTO
// carries the same shape the entities store.
$this->email = null === $email ? null : mb_strtolower(trim($email));
return $this;
}
+1 -1
View File
@@ -75,7 +75,7 @@ class Contact
public function setEmail(string $email): static
{
$this->email = $email;
$this->email = mb_strtolower(trim($email));
return $this;
}
+1 -1
View File
@@ -108,7 +108,7 @@ class Communication
public function setEmail(?string $email): static
{
$this->email = $email;
$this->email = null === $email ? null : mb_strtolower(trim($email));
return $this;
}
+1 -1
View File
@@ -43,7 +43,7 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
public function authenticate(Request $request): Passport
{
$email = trim($request->request->getString('_username'));
$email = mb_strtolower(trim($request->request->getString('_username')));
$passwordPlain = trim($request->request->getString('_password'));
// Very lame hashing applied here as required by BPN