RefreshTokenRepository.php in Simple OAuth (OAuth2) & OpenID Connect 8.3
File
src/Repositories/RefreshTokenRepository.php
View source
<?php
namespace Drupal\simple_oauth\Repositories;
use League\OAuth2\Server\Entities\RefreshTokenEntityInterface;
use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface;
class RefreshTokenRepository implements RefreshTokenRepositoryInterface {
use RevocableTokenRepositoryTrait;
protected static $bundle_id = 'refresh_token';
protected static $entity_class = 'Drupal\\simple_oauth\\Entities\\RefreshTokenEntity';
protected static $entity_interface = 'League\\OAuth2\\Server\\Entities\\RefreshTokenEntityInterface';
public function getNewRefreshToken() {
return $this
->getNew();
}
public function persistNewRefreshToken(RefreshTokenEntityInterface $refresh_token_entity) {
$this
->persistNew($refresh_token_entity);
}
public function revokeRefreshToken($token_id) {
$this
->revoke($token_id);
}
public function isRefreshTokenRevoked($token_id) {
return $this
->isRevoked($token_id);
}
}