From ed79f7c4ea3861383b991b5289b6416b9ba20536 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 3 Jun 2015 03:36:17 +0200 Subject: [PATCH] Fix middleware if cookie does not exist. --- src/Forum/Middleware/LoginWithCookie.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Forum/Middleware/LoginWithCookie.php b/src/Forum/Middleware/LoginWithCookie.php index c0765a1fd..cd4ee8051 100644 --- a/src/Forum/Middleware/LoginWithCookie.php +++ b/src/Forum/Middleware/LoginWithCookie.php @@ -23,9 +23,7 @@ class LoginWithCookie implements MiddlewareInterface */ public function __invoke(Request $request, Response $response, callable $out = null) { - $cookies = $request->getCookieParams(); - - if (($token = $cookies['flarum_remember']) && + if (($token = array_get($request->getCookieParams(), 'flarum_remember')) && ($accessToken = AccessToken::where('id', $token)->first()) ) { $this->actor->setUser($user = $accessToken->user);