mirror of
https://github.com/flarum/framework.git
synced 2024-11-27 19:13:37 +08:00
rename TokenController to CreateTokenController
This commit is contained in:
parent
3bf74eaf10
commit
22f2df3670
|
@ -21,7 +21,7 @@ use Psr\Http\Message\ServerRequestInterface;
|
|||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class TokenController implements RequestHandlerInterface
|
||||
class CreateTokenController implements RequestHandlerInterface
|
||||
{
|
||||
/**
|
||||
* @var \Flarum\User\UserRepository
|
|
@ -25,7 +25,7 @@ return function (RouteCollection $map, RouteHandlerFactory $route) {
|
|||
$map->post(
|
||||
'/token',
|
||||
'token',
|
||||
$route->toController(Controller\TokenController::class)
|
||||
$route->toController(Controller\CreateTokenController::class)
|
||||
);
|
||||
|
||||
// Send forgot password email
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace Flarum\Forum\Controller;
|
||||
|
||||
use Flarum\Api\Client;
|
||||
use Flarum\Api\Controller\TokenController;
|
||||
use Flarum\Api\Controller\CreateTokenController;
|
||||
use Flarum\Http\AccessToken;
|
||||
use Flarum\Http\Rememberer;
|
||||
use Flarum\Http\SessionAuthenticator;
|
||||
|
@ -67,7 +67,7 @@ class LogInController implements RequestHandlerInterface
|
|||
$body = $request->getParsedBody();
|
||||
$params = array_only($body, ['identification', 'password']);
|
||||
|
||||
$response = $this->apiClient->send(TokenController::class, $actor, [], $params);
|
||||
$response = $this->apiClient->send(CreateTokenController::class, $actor, [], $params);
|
||||
|
||||
if ($response->getStatusCode() === 200) {
|
||||
$data = json_decode($response->getBody());
|
||||
|
|
|
@ -11,15 +11,15 @@
|
|||
|
||||
namespace Flarum\Tests\Api\Controller;
|
||||
|
||||
use Flarum\Api\Controller\TokenController;
|
||||
use Flarum\Api\Controller\CreateTokenController;
|
||||
use Flarum\Http\AccessToken;
|
||||
use Flarum\Tests\Test\Concerns\RetrievesAuthorizedUsers;
|
||||
|
||||
class TokenControllerTest extends ApiControllerTestCase
|
||||
class CreateTokenControllerTest extends ApiControllerTestCase
|
||||
{
|
||||
use RetrievesAuthorizedUsers;
|
||||
|
||||
protected $controller = TokenController::class;
|
||||
protected $controller = CreateTokenController::class;
|
||||
|
||||
/**
|
||||
* @test
|
Loading…
Reference in New Issue
Block a user