8000 Fix offset error on invalid remember token (#34020) · laravel/framework@134f1dc · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 134f1dc

Browse files
authored
Fix offset error on invalid remember token (#34020)
1 parent 0fc3711 commit 134f1dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/Session/Middleware/AuthenticateSession.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public function handle($request, Closure $next)
4040
}
4141

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

45-
if ($passwordHash != $request->user()->getAuthPassword()) {
45+
if (! $passwordHash || $passwordHash != $request->user()->getAuthPassword()) {
4646
$this->logout($request);
4747
}
4848
}

0 commit comments

Comments
 (0)
0