diff --git a/framework/core/src/Web/Middleware/LoginWithCookie.php b/framework/core/src/Web/Middleware/LoginWithCookie.php index dd8f7acb1..e496ee133 100644 --- a/framework/core/src/Web/Middleware/LoginWithCookie.php +++ b/framework/core/src/Web/Middleware/LoginWithCookie.php @@ -18,7 +18,7 @@ class LoginWithCookie { if (($token = $request->cookie('flarum_remember')) && ($accessToken = AccessToken::where('id', $token)->first())) { - $this->actor->setUser($accessToken->user); + $this->actor->setUser($user = $accessToken->user); $user->updateLastSeen()->save(); }