From e8e5d76f119815c0d9963a95c99f6a9ea43abb9a Mon Sep 17 00:00:00 2001 From: Rich Shank Date: Sun, 15 Oct 2023 10:39:25 -0500 Subject: [PATCH] make sure emails are saved as lowercase --- src/Authentication/Interactor/CreateAuthLookup.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Authentication/Interactor/CreateAuthLookup.php b/src/Authentication/Interactor/CreateAuthLookup.php index 4cf24cd..0bb9b4c 100644 --- a/src/Authentication/Interactor/CreateAuthLookup.php +++ b/src/Authentication/Interactor/CreateAuthLookup.php @@ -21,10 +21,11 @@ public function create(NewAuthLookupInterface $newAuthLookup): UuidInterface $username = $newAuthLookup->getUsername(); $id = Uuid::uuid4(); $password = password_hash($newAuthLookup->getPassword(), PASSWORD_BCRYPT); + $email = strtolower($newAuthLookup->getEmail()); $sql = <<authAdapter->getTableName()} (email, id, password, username) - VALUES ('{$newAuthLookup->getEmail()}', '{$id->toString()}', '$password', '$username'); + VALUES ('{$email}', '{$id->toString()}', '$password', '$username'); SQL; $dbAdapter = $this->authAdapter->getDbAdapter(); $statement = $dbAdapter->createStatement($sql);