for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Alex Bilbie <[email protected]>
* @copyright Copyright (c) Alex Bilbie
* @license http://mit-license.org/
*
* @link https://github.com/thephpleague/oauth2-server
*/
declare(strict_types=1);
namespace OAuth2ServerExamples\Repositories;
use League\OAuth2\Server\Entities\RefreshTokenEntityInterface;
use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface;
use OAuth2ServerExamples\Entities\RefreshTokenEntity;
class RefreshTokenRepository implements RefreshTokenRepositoryInterface
{
* {@inheritdoc}
public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntity): void
// Some logic to persist the refresh token in a database
}
public function revokeRefreshToken($tokenId): void
// Some logic to revoke the refresh token in a database
public function isRefreshTokenRevoked($tokenId): bool
return false; // The refresh token has not been revoked
public function getNewRefreshToken(): ?RefreshTokenEntityInterface
return new RefreshTokenEntity();