mirror of
https://github.com/flarum/framework.git
synced 2024-12-11 21:43:38 +08:00
Fix middleware if cookie does not exist.
This commit is contained in:
parent
07ef273d1b
commit
eb7dc1a7fe
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user