mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* @author Alex Bilbie <hello@alexbilbie.com>
|
|
* @copyright Copyright (c) Alex Bilbie
|
|
* @license http://mit-license.org/
|
|
*
|
|
* @link https://github.com/thephpleague/oauth2-server
|
|
*/
|
|
|
|
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 $refreshTokenEntityInterface)
|
|
{
|
|
// Some logic to persist the refresh token in a database
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function revokeRefreshToken($tokenId)
|
|
{
|
|
// Some logic to revoke the refresh token in a database
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function isRefreshTokenRevoked($tokenId)
|
|
{
|
|
return false; // The refresh token has not been revoked
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getNewRefreshToken()
|
|
{
|
|
return new RefreshTokenEntity();
|
|
}
|
|
}
|