mirror of
https://github.com/webmasterskaya/joomla-oauth-server.git
synced 2024-11-23 22:34:50 +03:00
dispatch TokenRequestResolveEvent
This commit is contained in:
parent
f4ad545ba5
commit
d1ff6dbd4f
@ -26,6 +26,7 @@ use League\OAuth2\Server\Grant\ClientCredentialsGrant;
|
|||||||
use League\OAuth2\Server\Grant\ImplicitGrant;
|
use League\OAuth2\Server\Grant\ImplicitGrant;
|
||||||
use League\OAuth2\Server\Grant\RefreshTokenGrant;
|
use League\OAuth2\Server\Grant\RefreshTokenGrant;
|
||||||
use League\OAuth2\Server\RequestEvent;
|
use League\OAuth2\Server\RequestEvent;
|
||||||
|
use Webmasterskaya\Component\OauthServer\Administrator\Event\TokenRequestResolveEvent;
|
||||||
use Webmasterskaya\Component\OauthServer\Administrator\Model\AccessTokenModel;
|
use Webmasterskaya\Component\OauthServer\Administrator\Model\AccessTokenModel;
|
||||||
use Webmasterskaya\Component\OauthServer\Administrator\Model\AuthCodeModel;
|
use Webmasterskaya\Component\OauthServer\Administrator\Model\AuthCodeModel;
|
||||||
use Webmasterskaya\Component\OauthServer\Administrator\Model\ClientModel;
|
use Webmasterskaya\Component\OauthServer\Administrator\Model\ClientModel;
|
||||||
@ -270,8 +271,13 @@ class LoginController extends BaseController
|
|||||||
{
|
{
|
||||||
$server = $this->authorizationServer;
|
$server = $this->authorizationServer;
|
||||||
$serverRequest = ServerRequestFactory::fromGlobals();
|
$serverRequest = ServerRequestFactory::fromGlobals();
|
||||||
$serverResponse = $this->app->getResponse();
|
$response = $this->app->getResponse();
|
||||||
$this->app->setResponse($server->respondToAccessTokenRequest($serverRequest, $serverResponse));
|
$response = $server->respondToAccessTokenRequest($serverRequest, $response);
|
||||||
|
$event = new TokenRequestResolveEvent('onTokenRequestResolve', ['response' => $response]);
|
||||||
|
|
||||||
|
$this->getDispatcher()->dispatch($event->getName(), $event);
|
||||||
|
$this->app->setResponse($event->getArgument('response'));
|
||||||
|
|
||||||
echo $this->app->getResponse()->getBody();
|
echo $this->app->getResponse()->getBody();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
Loading…
Reference in New Issue
Block a user