diff --git a/src/Api/Controller/TokenController.php b/src/Api/Controller/CreateTokenController.php similarity index 96% rename from src/Api/Controller/TokenController.php rename to src/Api/Controller/CreateTokenController.php index 268f4a598..563bd9ed1 100644 --- a/src/Api/Controller/TokenController.php +++ b/src/Api/Controller/CreateTokenController.php @@ -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 diff --git a/src/Api/routes.php b/src/Api/routes.php index c532f7e03..8e3ccd2f3 100644 --- a/src/Api/routes.php +++ b/src/Api/routes.php @@ -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 diff --git a/src/Forum/Controller/LogInController.php b/src/Forum/Controller/LogInController.php index cf62d81e9..7e91168fd 100644 --- a/src/Forum/Controller/LogInController.php +++ b/src/Forum/Controller/LogInController.php @@ -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()); diff --git a/tests/Api/Controller/TokenControllerTest.php b/tests/Api/Controller/CreateTokenControllerTest.php similarity index 84% rename from tests/Api/Controller/TokenControllerTest.php rename to tests/Api/Controller/CreateTokenControllerTest.php index a350fa823..82d0f6de3 100644 --- a/tests/Api/Controller/TokenControllerTest.php +++ b/tests/Api/Controller/CreateTokenControllerTest.php @@ -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