Skip to content

Commit

Permalink
Fix offset error on invalid remember token (#34020)
Browse files Browse the repository at this point in the history
  • Loading branch information
ERPedersen committed Aug 26, 2020
1 parent 0fc3711 commit 134f1dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Session/Middleware/AuthenticateSession.php
Expand Up @@ -40,9 +40,9 @@ public function handle($request, Closure $next)
}

if ($this->auth->viaRemember()) {
$passwordHash = explode('|', $request->cookies->get($this->auth->getRecallerName()))[2];
$passwordHash = explode('|', $request->cookies->get($this->auth->getRecallerName()))[2] ?? null;

if ($passwordHash != $request->user()->getAuthPassword()) {
if (! $passwordHash || $passwordHash != $request->user()->getAuthPassword()) {
$this->logout($request);
}
}
Expand Down

0 comments on commit 134f1dc

Please sign in to comment.