Skip to content

Commit

Permalink
Set revokeRefreshTokens prop to true by default, added method to chan…
Browse files Browse the repository at this point in the history
…ge, cleaned up constructor.
  • Loading branch information
janhopman-nhb committed Jun 1, 2021
1 parent 5cf9d07 commit c808d13
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/AuthorizationServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class AuthorizationServer implements EmitterAwareInterface
/**
* @var bool
*/
private $revokeRefreshTokens;
private $revokeRefreshTokens = true;

/**
* New server instance.
Expand All @@ -93,16 +93,14 @@ class AuthorizationServer implements EmitterAwareInterface
* @param CryptKey|string $privateKey
* @param string|Key $encryptionKey
* @param null|ResponseTypeInterface $responseType
* @param bool $revokeRefreshTokens
*/
public function __construct(
ClientRepositoryInterface $clientRepository,
AccessTokenRepositoryInterface $accessTokenRepository,
ScopeRepositoryInterface $scopeRepository,
$privateKey,
$encryptionKey,
ResponseTypeInterface $responseType = null,
bool $revokeRefreshTokens = true
ResponseTypeInterface $responseType = null
) {
$this->clientRepository = $clientRepository;
$this->accessTokenRepository = $accessTokenRepository;
Expand All @@ -122,7 +120,6 @@ public function __construct(
}

$this->responseType = $responseType;
$this->revokeRefreshTokens = $revokeRefreshTokens;
}

/**
Expand Down Expand Up @@ -242,4 +239,14 @@ public function setDefaultScope($defaultScope)
{
$this->defaultScope = $defaultScope;
}

/**
* Sets wether to revoke refresh tokens or not (for all grant types).
*
* @param bool $revokeRefreshTokens
*/
public function setRevokeRefreshTokens(bool $revokeRefreshTokens): void
{
$this->revokeRefreshTokens = $revokeRefreshTokens;
}
}

0 comments on commit c808d13

Please sign in to comment.