mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
Removed unused code
This commit is contained in:
parent
c490cd4ef2
commit
edf0ee8622
@ -67,15 +67,6 @@ interface TokenInterface
|
|||||||
*/
|
*/
|
||||||
public function addScope(ScopeEntityInterface $scope);
|
public function addScope(ScopeEntityInterface $scope);
|
||||||
|
|
||||||
/**
|
|
||||||
* Get an associated scope by the scope's identifier.
|
|
||||||
*
|
|
||||||
* @param string $identifier
|
|
||||||
*
|
|
||||||
* @return ScopeEntityInterface|null The scope or null if not found
|
|
||||||
*/
|
|
||||||
public function getScopeWithIdentifier($identifier);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an array of scopes associated with the token.
|
* Return an array of scopes associated with the token.
|
||||||
*
|
*
|
||||||
|
@ -38,18 +38,6 @@ trait TokenEntityTrait
|
|||||||
$this->scopes[$scope->getIdentifier()] = $scope;
|
$this->scopes[$scope->getIdentifier()] = $scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get an associated scope by the scope's identifier.
|
|
||||||
*
|
|
||||||
* @param string $identifier
|
|
||||||
*
|
|
||||||
* @return ScopeEntityInterface|null The scope or null if not found
|
|
||||||
*/
|
|
||||||
public function getScopeWithIdentifier($identifier)
|
|
||||||
{
|
|
||||||
return (isset($this->scopes[$identifier])) ? $this->scopes[$identifier] : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an array of scopes associated with the token.
|
* Return an array of scopes associated with the token.
|
||||||
*
|
*
|
||||||
|
@ -48,20 +48,6 @@ class OAuthServerException extends \Exception
|
|||||||
$this->redirectUri = $redirectUri;
|
$this->redirectUri = $redirectUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Invalid grant type error.
|
|
||||||
*
|
|
||||||
* @return static
|
|
||||||
*/
|
|
||||||
public static function invalidGrantType()
|
|
||||||
{
|
|
||||||
$errorMessage = 'The provided authorization grant is invalid, expired, revoked, does not match ' .
|
|
||||||
'the redirection URI used in the authorization request, or was issued to another client.';
|
|
||||||
$hint = 'Check the `grant_type` parameter';
|
|
||||||
|
|
||||||
return new static($errorMessage, 1, 'invalid_grant', 400, $hint);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unsupported grant type error.
|
* Unsupported grant type error.
|
||||||
*
|
*
|
||||||
@ -206,7 +192,7 @@ class OAuthServerException extends \Exception
|
|||||||
$headers = $this->getHttpHeaders();
|
$headers = $this->getHttpHeaders();
|
||||||
|
|
||||||
$payload = [
|
$payload = [
|
||||||
'error' => $this->errorType,
|
'error' => $this->getErrorType(),
|
||||||
'message' => $this->getMessage(),
|
'message' => $this->getMessage(),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -47,10 +47,6 @@ class AuthenticationServerMiddleware
|
|||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($response->getStatusCode(), [400, 401, 500])) {
|
|
||||||
return $response;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pass the request and response on to the next responder in the chain
|
// Pass the request and response on to the next responder in the chain
|
||||||
return $next($request, $response);
|
return $next($request, $response);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user