Skip to content

Commit

Permalink
make sure emails are saved as lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
iampersistent committed Oct 15, 2023
1 parent 9812095 commit e8e5d76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Authentication/Interactor/CreateAuthLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <<<SQL
INSERT INTO {$this->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);
Expand Down

0 comments on commit e8e5d76

Please sign in to comment.