mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 07:03:35 +08:00
Fix cookie retrieval in admin panel
This commit is contained in:
parent
53d2259f8e
commit
9f01a60243
|
@ -1,10 +1,10 @@
|
||||||
<?php namespace Flarum\Admin\Actions;
|
<?php namespace Flarum\Admin\Actions;
|
||||||
|
|
||||||
|
use Dflydev\FigCookies\FigRequestCookies;
|
||||||
use Flarum\Api\Client;
|
use Flarum\Api\Client;
|
||||||
use Flarum\Support\Actor;
|
use Flarum\Support\Actor;
|
||||||
use Flarum\Support\HtmlAction;
|
use Flarum\Support\HtmlAction;
|
||||||
use Session;
|
use Session;
|
||||||
use Cookie;
|
|
||||||
use Config;
|
use Config;
|
||||||
use DB;
|
use DB;
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
|
@ -31,7 +31,7 @@ class IndexAction extends HtmlAction
|
||||||
if (($user = $this->actor->getUser()) && $user->exists) {
|
if (($user = $this->actor->getUser()) && $user->exists) {
|
||||||
$session = [
|
$session = [
|
||||||
'userId' => $user->id,
|
'userId' => $user->id,
|
||||||
'token' => Cookie::get('flarum_remember')
|
'token' => FigRequestCookies::get($request, 'flarum_remember'),
|
||||||
];
|
];
|
||||||
|
|
||||||
$response = $this->apiClient->send('Flarum\Api\Actions\Users\ShowAction', ['id' => $user->id]);
|
$response = $this->apiClient->send('Flarum\Api\Actions\Users\ShowAction', ['id' => $user->id]);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user