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 30069db commit 6c20b6d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Http/Middleware/AuthenticateSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ public function handle(Request $request, Closure $next): Response
}

return tap($next($request), function () use ($request, $guards) {
$guard = $this->getFirstGuardWithUser($guards->keys());

if (! is_null($guard)) {
if (! is_null($guard = $this->getFirstGuardWithUser($guards->keys()))) {
$this->storePasswordHashInSession($request, $guard);
}
});
Expand All @@ -92,10 +90,6 @@ protected function getFirstGuardWithUser(Collection $guards)
*/
protected function storePasswordHashInSession($request, string $guard)
{
if (! $this->auth->guard($guard)->hasUser()) {
return;
}

$request->session()->put([
"password_hash_{$guard}" => $this->auth->guard($guard)->user()->getAuthPassword(),
]);
Expand Down

0 comments on commit 6c20b6d

Please sign in to comment.