mirror of
https://github.com/flarum/framework.git
synced 2024-11-24 14:05:51 +08:00
Fix middleware if cookie does not exist.
This commit is contained in:
parent
2ba7a2044b
commit
ed79f7c4ea
|
@ -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