mirror of
https://github.com/webmasterskaya/joomla-oauth-server.git
synced 2024-11-23 22:34:50 +03:00
rename event
This commit is contained in:
parent
aeffcc47ee
commit
b4280c45e3
@ -13,7 +13,7 @@ use Joomla\CMS\Event\AbstractEvent;
|
|||||||
use League\OAuth2\Server\Entities\ClientEntityInterface;
|
use League\OAuth2\Server\Entities\ClientEntityInterface;
|
||||||
use Webmasterskaya\Component\OauthServer\Site\Entity\Scope;
|
use Webmasterskaya\Component\OauthServer\Site\Entity\Scope;
|
||||||
|
|
||||||
class ScopeResolveEvent extends AbstractEvent
|
class ResolveScopeEvent extends AbstractEvent
|
||||||
{
|
{
|
||||||
private bool $constructed = false;
|
private bool $constructed = false;
|
||||||
|
|
@ -12,7 +12,7 @@ namespace Webmasterskaya\Component\OauthServer\Administrator\Event;
|
|||||||
use Joomla\CMS\Event\AbstractEvent;
|
use Joomla\CMS\Event\AbstractEvent;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class TokenRequestResolveEvent extends AbstractEvent
|
class ResolveTokenRequestEvent extends AbstractEvent
|
||||||
{
|
{
|
||||||
public function __construct(string $name, array $arguments = [])
|
public function __construct(string $name, array $arguments = [])
|
||||||
{
|
{
|
@ -29,7 +29,7 @@ use League\OAuth2\Server\RequestEvent as LeagueRequestEvent;
|
|||||||
use Webmasterskaya\Component\OauthServer\Administrator\Event\RequestAccessTokenEvent;
|
use Webmasterskaya\Component\OauthServer\Administrator\Event\RequestAccessTokenEvent;
|
||||||
use Webmasterskaya\Component\OauthServer\Administrator\Event\RequestEvent;
|
use Webmasterskaya\Component\OauthServer\Administrator\Event\RequestEvent;
|
||||||
use Webmasterskaya\Component\OauthServer\Administrator\Event\RequestRefreshTokenEvent;
|
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\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;
|
||||||
@ -304,7 +304,7 @@ class LoginController extends BaseController
|
|||||||
$serverRequest = ServerRequestFactory::fromGlobals();
|
$serverRequest = ServerRequestFactory::fromGlobals();
|
||||||
$response = $this->app->getResponse();
|
$response = $this->app->getResponse();
|
||||||
$response = $server->respondToAccessTokenRequest($serverRequest, $response);
|
$response = $server->respondToAccessTokenRequest($serverRequest, $response);
|
||||||
$event = new TokenRequestResolveEvent('onTokenRequestResolve', ['response' => $response]);
|
$event = new ResolveTokenRequestEvent('onResolveTokenRequest', ['response' => $response]);
|
||||||
|
|
||||||
$this->getDispatcher()->dispatch($event->getName(), $event);
|
$this->getDispatcher()->dispatch($event->getName(), $event);
|
||||||
$this->app->setResponse($event->getArgument('response'));
|
$this->app->setResponse($event->getArgument('response'));
|
||||||
|
@ -14,7 +14,7 @@ use Joomla\Event\DispatcherAwareTrait;
|
|||||||
use League\OAuth2\Server\Entities\ClientEntityInterface;
|
use League\OAuth2\Server\Entities\ClientEntityInterface;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
|
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\Administrator\Model\ClientModel;
|
||||||
use Webmasterskaya\Component\OauthServer\Site\Entity\Scope;
|
use Webmasterskaya\Component\OauthServer\Site\Entity\Scope;
|
||||||
|
|
||||||
@ -68,8 +68,8 @@ class ScopeRepository implements ScopeRepositoryInterface, DispatcherAwareInterf
|
|||||||
|
|
||||||
$scopes = $this->setupScopes($client, array_values($scopes));
|
$scopes = $this->setupScopes($client, array_values($scopes));
|
||||||
|
|
||||||
$event = new ScopeResolveEvent(
|
$event = new ResolveScopeEvent(
|
||||||
'onScopeResolve',
|
'onOauthResolveScope',
|
||||||
[
|
[
|
||||||
'scopes' => $scopes,
|
'scopes' => $scopes,
|
||||||
'grant' => $grantType,
|
'grant' => $grantType,
|
||||||
|
Loading…
Reference in New Issue
Block a user