mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
minor improvements and documentation fixes
This commit is contained in:
@@ -38,9 +38,8 @@ class RefreshTokenGrant extends AbstractGrant
|
||||
/**
|
||||
* @param \League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface $refreshTokenRepository
|
||||
*/
|
||||
public function __construct(
|
||||
RefreshTokenRepositoryInterface $refreshTokenRepository
|
||||
) {
|
||||
public function __construct(RefreshTokenRepositoryInterface $refreshTokenRepository)
|
||||
{
|
||||
$this->refreshTokenRepository = $refreshTokenRepository;
|
||||
}
|
||||
|
||||
@@ -64,7 +63,7 @@ class RefreshTokenGrant extends AbstractGrant
|
||||
// the request doesn't include any new scopes
|
||||
foreach ($scopes as $scope) {
|
||||
if (in_array($scope->getIdentifier(), $oldRefreshToken['scopes']) === false) {
|
||||
$this->emitter->emit(new Event('scope.selection.failed', $request));
|
||||
$this->getEmitter()->emit(new Event('scope.selection.failed', $request));
|
||||
|
||||
throw OAuthServerException::invalidScope($scope->getIdentifier());
|
||||
}
|
||||
@@ -112,7 +111,7 @@ class RefreshTokenGrant extends AbstractGrant
|
||||
|
||||
$refreshTokenData = json_decode($refreshToken, true);
|
||||
if ($refreshTokenData['client_id'] !== $clientId) {
|
||||
$this->emitter->emit(new Event('refresh_token.client.failed', $request));
|
||||
$this->getEmitter()->emit(new Event('refresh_token.client.failed', $request));
|
||||
|
||||
throw OAuthServerException::invalidRefreshToken(
|
||||
'Token is not linked to client,' .
|
||||
|
||||
Reference in New Issue
Block a user