Skip to content

Commit

Permalink
Fix PAT token is not works with usernames with capital letter
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsykun committed Oct 28, 2023
1 parent efc70eb commit d949380
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 d949380

Please sign in to comment.