rename event

This commit is contained in:
Artem Vasilev 2024-03-14 23:28:26 +03:00
parent aeffcc47ee
commit b4280c45e3
4 changed files with 7 additions and 7 deletions

View File

@ -13,7 +13,7 @@ use Joomla\CMS\Event\AbstractEvent;
use League\OAuth2\Server\Entities\ClientEntityInterface;
use Webmasterskaya\Component\OauthServer\Site\Entity\Scope;
class ScopeResolveEvent extends AbstractEvent
class ResolveScopeEvent extends AbstractEvent
{
private bool $constructed = false;

View File

@ -12,7 +12,7 @@ namespace Webmasterskaya\Component\OauthServer\Administrator\Event;
use Joomla\CMS\Event\AbstractEvent;
use Psr\Http\Message\ResponseInterface;
class TokenRequestResolveEvent extends AbstractEvent
class ResolveTokenRequestEvent extends AbstractEvent
{
public function __construct(string $name, array $arguments = [])
{

View File

@ -29,7 +29,7 @@ use League\OAuth2\Server\RequestEvent as LeagueRequestEvent;
use Webmasterskaya\Component\OauthServer\Administrator\Event\RequestAccessTokenEvent;
use Webmasterskaya\Component\OauthServer\Administrator\Event\RequestEvent;
use Webmasterskaya\Component\OauthServer\Administrator\Event\RequestRefreshTokenEvent;
use Webmasterskaya\Component\OauthServer\Administrator\Event\TokenRequestResolveEvent;
use Webmasterskaya\Component\OauthServer\Administrator\Event\ResolveTokenRequestEvent;
use Webmasterskaya\Component\OauthServer\Administrator\Model\AccessTokenModel;
use Webmasterskaya\Component\OauthServer\Administrator\Model\AuthCodeModel;
use Webmasterskaya\Component\OauthServer\Administrator\Model\ClientModel;
@ -304,7 +304,7 @@ class LoginController extends BaseController
$serverRequest = ServerRequestFactory::fromGlobals();
$response = $this->app->getResponse();
$response = $server->respondToAccessTokenRequest($serverRequest, $response);
$event = new TokenRequestResolveEvent('onTokenRequestResolve', ['response' => $response]);
$event = new ResolveTokenRequestEvent('onResolveTokenRequest', ['response' => $response]);
$this->getDispatcher()->dispatch($event->getName(), $event);
$this->app->setResponse($event->getArgument('response'));

View File

@ -14,7 +14,7 @@ use Joomla\Event\DispatcherAwareTrait;
use League\OAuth2\Server\Entities\ClientEntityInterface;
use League\OAuth2\Server\Exception\OAuthServerException;
use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
use Webmasterskaya\Component\OauthServer\Administrator\Event\ScopeResolveEvent;
use Webmasterskaya\Component\OauthServer\Administrator\Event\ResolveScopeEvent;
use Webmasterskaya\Component\OauthServer\Administrator\Model\ClientModel;
use Webmasterskaya\Component\OauthServer\Site\Entity\Scope;
@ -68,8 +68,8 @@ class ScopeRepository implements ScopeRepositoryInterface, DispatcherAwareInterf
$scopes = $this->setupScopes($client, array_values($scopes));
$event = new ScopeResolveEvent(
'onScopeResolve',
$event = new ResolveScopeEvent(
'onOauthResolveScope',
[
'scopes' => $scopes,
'grant' => $grantType,