Skip to content

Commit

Permalink
Merge pull request #4 from locomotivemtl/fix-email-case-sensivity
Browse files Browse the repository at this point in the history
Fix email case sensitivity
  • Loading branch information
JoelAlphonso authored Dec 3, 2019
2 parents 8350e7a + 512d481 commit 4b94348
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 0 additions & 5 deletions src/Charcoal/User/AbstractAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,6 @@ public function authenticateByPassword($identifier, $password, $remember = false
// Load the user by email
$user->loadFrom($user->getAuthIdentifierKey(), $identifier);

// Check identifier is as requested
if ($user->getAuthIdentifier() !== $identifier) {
return null;
}

// Allow model to validate user standing
if (!$this->validateAuthentication($user)) {
return null;
Expand Down
5 changes: 3 additions & 2 deletions src/Charcoal/User/AbstractUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,16 +531,17 @@ protected function validateLoginUnique()

$originalUser = $factory->create($objType)->load($this->getAuthId());

if ($originalUser->id() && $originalUser->getAuthIdentifier() !== $userLogin) {
if ($originalUser->getAuthIdentifier() !== $userLogin) {
$existingUser = $factory->create($objType)->loadFrom($userKey, $userLogin);
/** Check for existing user with given email. */
if (!empty($existingUser->getAuthId())) {
$this->validator()->error(
sprintf('User Credentials: "%s" is not available.', $userKey),
$userKey
);

return false;
}
return false;
}

return true;
Expand Down

0 comments on commit 4b94348

Please sign in to comment.