From eb7dc1a7feff14e2fb80a5e1d84414a886f2831e 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. --- framework/core/src/Forum/Middleware/LoginWithCookie.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/framework/core/src/Forum/Middleware/LoginWithCookie.php b/framework/core/src/Forum/Middleware/LoginWithCookie.php index c0765a1fd..cd4ee8051 100644 --- a/framework/core/src/Forum/Middleware/LoginWithCookie.php +++ b/framework/core/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);