Skip to content

Commit

Permalink
Merge pull request #185 from vtsykun/fix/pat-token
Browse files Browse the repository at this point in the history
Fix PAT token is not works with usernames with capital letter
  • Loading branch information
vtsykun authored Oct 28, 2023
2 parents 8f4c96e + 07bb18b commit a24d4d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Model/BaseUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function setUsername($username)
*/
public function setUsernameCanonical($usernameCanonical)
{
$this->usernameCanonical = $usernameCanonical;
$this->usernameCanonical = mb_strtolower($usernameCanonical);

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function findOneByUsernameOrEmail(string $usernameOrEmail)
}
}

return $this->findOneBy(['usernameCanonical' => $usernameOrEmail]);
return $this->findOneBy(['usernameCanonical' => mb_strtolower($usernameOrEmail)]);
}

public function getPackageMaintainersQueryBuilder(Package $package, User $excludeUser=null)
Expand Down

0 comments on commit a24d4d1

Please sign in to comment.