diff --git a/framework/core/src/Http/Middleware/AuthenticateWithCookie.php b/framework/core/src/Http/Middleware/AuthenticateWithCookie.php index 87d06d8a8..f39f7a2aa 100644 --- a/framework/core/src/Http/Middleware/AuthenticateWithCookie.php +++ b/framework/core/src/Http/Middleware/AuthenticateWithCookie.php @@ -55,7 +55,8 @@ class AuthenticateWithCookie implements MiddlewareInterface if ($token = $this->getToken($request)) { if (! $token->isValid()) { // TODO: https://github.com/flarum/core/issues/253 - } elseif ($actor = $token->user) { + } elseif ($token->user) { + $actor = $token->user; $actor->updateLastSeen()->save(); } }