From 84b4661181c41d45d7aaa87b0ee7fedaca1ecb7a Mon Sep 17 00:00:00 2001 From: Artem Vasilev Date: Fri, 8 Mar 2024 02:20:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=82=D0=BE=D0=BA=D0=B5=D0=BD=D0=B0=20(=D1=81=D0=BB?= =?UTF-8?q?=D0=BE=D0=BC=D0=B0=D0=BB=D0=BE=D1=81=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- com_oauthserver/site/src/Controller/LoginController.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/com_oauthserver/site/src/Controller/LoginController.php b/com_oauthserver/site/src/Controller/LoginController.php index bfe749e..373032e 100644 --- a/com_oauthserver/site/src/Controller/LoginController.php +++ b/com_oauthserver/site/src/Controller/LoginController.php @@ -5,10 +5,8 @@ namespace Webmasterskaya\Component\OauthServer\Site\Controller; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Component\ComponentHelper; use League\OAuth2\Server\CryptKey; -use League\OAuth2\Server\Exception\OAuthServerException; use League\OAuth2\Server\Grant\ClientCredentialsGrant; use League\OAuth2\Server\Grant\ImplicitGrant; -use League\OAuth2\Server\Grant\PasswordGrant; use League\OAuth2\Server\Grant\RefreshTokenGrant; use Webmasterskaya\Component\OauthServer\Site\Entity\User as UserEntity; use Joomla\CMS\MVC\Controller\BaseController; @@ -206,10 +204,11 @@ class LoginController extends BaseController */ public function token(): void { - $app = $this->app; $server = $this->authorizationServer; $serverRequest = ServerRequestFactory::fromGlobals(); - $serverResponse = $app->getResponse(); - $app->setResponse($server->respondToAccessTokenRequest($serverRequest, $serverResponse)); + $serverResponse = $this->app->getResponse(); + $this->app->setResponse($server->respondToAccessTokenRequest($serverRequest, $serverResponse)); + $this->app->getInput()->set('format', 'json'); + //TODO: WTF!??!?! Какого хрена оно отдаёт простой HTML? } } \ No newline at end of file