diff --git a/src/AbstractServer.php b/src/AbstractServer.php index 9e0f1b98..f8dc1963 100644 --- a/src/AbstractServer.php +++ b/src/AbstractServer.php @@ -125,6 +125,7 @@ abstract class AbstractServer */ public function setTokenType(TokenTypeInterface $tokenType) { + $tokenType->setServer($this); $this->tokenType = $tokenType; } diff --git a/src/TokenType/AbstractTokenType.php b/src/TokenType/AbstractTokenType.php index c106b546..56266ac0 100644 --- a/src/TokenType/AbstractTokenType.php +++ b/src/TokenType/AbstractTokenType.php @@ -12,6 +12,7 @@ namespace League\OAuth2\Server\TokenType; use Symfony\Component\HttpFoundation\Request; +use League\OAuth2\Server\AbstractServer; abstract class AbstractTokenType { @@ -22,6 +23,21 @@ abstract class AbstractTokenType protected $response = []; /** + * Server + * @var \League\OAuth2\Server\AbstractServer $server + */ + protected $server; + + /** + * Set the server + * @param \League\OAuth2\Server\AbstractServer $server + */ + public function setServer(AbstractServer $server) + { + $this->server = $server; + return $this; + } + * Set a key/value response pair * @param string $key * @param mixed $value