Skip to content

Commit 2db7baa

Browse files
committed
Correct LoginRequest retrieved user type to allow null
The issue was caused by a too-strict PHPDoc that assumed the retrieved user is always a User. However, `retrieveByCredentials()` can return null. This aligns the docblock with the actual return type, making the subsequent null/credential checks type-safe.
1 parent 904c9ff commit 2db7baa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Http/Requests/Auth/LoginRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function validateCredentials(): User
4141
{
4242
$this->ensureIsNotRateLimited();
4343

44-
/** @var User $user */
44+
/** @var User|null $user */
4545
$user = Auth::getProvider()->retrieveByCredentials($this->only('email', 'password'));
4646

4747
if (! $user || ! Auth::getProvider()->validateCredentials($user, $this->only('password'))) {

0 commit comments

Comments
 (0)