rename TokenController to CreateTokenController

This commit is contained in:
Sajjad Hashemian 2018-06-06 09:40:29 +04:30
parent 3bf74eaf10
commit 22f2df3670
4 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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());

View File

@ -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