Skip to content

Commit

Permalink
Merge pull request #11751 from nanaya/login-search-username-space
Browse files Browse the repository at this point in the history
Trim username in all cases on login
  • Loading branch information
notbakaneko authored Dec 18, 2024
2 parents 4c734d2 + 90d6590 commit fc60d2d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2128,8 +2128,10 @@ public static function attemptLogin($user, $password, $ip = null)

public static function findForLogin($username, $allowEmail = false)
{
if (!present($username)) {
return;
$username = trim($username ?? '');

if ($username === null) {
return null;
}

$query = static::where('username', $username);
Expand Down

0 comments on commit fc60d2d

Please sign in to comment.