feat: normalize email addresses to lowercase on write
This commit is contained in:
1 parent
d6327f033e
commit
af46c57bd1
7 files changed
+102
-4
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class Contact
|
||||
|
||||
public function setEmail(string $email): static
|
||||
{
|
||||
$this->email = $email;
|
||||
$this->email = mb_strtolower(trim($email));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user