Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Apr 10, 2024
1 parent 6c20b6d commit 15114b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Http/Middleware/AuthenticateSession.php
Expand Up @@ -78,7 +78,12 @@ public function handle(Request $request, Closure $next): Response
*/
protected function getFirstGuardWithUser(Collection $guards)
{
return $guards->first(fn ($guard) => $this->auth->guard($guard)->hasUser());
return $guards->first(function ($guard) {
$guardInstance = $this->auth->guard($guard);

return method_exists($guardInstance, 'hasUser') &&
$guardInstance->hasUser();
});
}

/**
Expand Down

0 comments on commit 15114b0

Please sign in to comment.