mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
50 lines
1.1 KiB
PHP
50 lines
1.1 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\AuthCodeEntityInterface;
|
|
use League\OAuth2\Server\Repositories\AuthCodeRepositoryInterface;
|
|
use OAuth2ServerExamples\Entities\AuthCodeEntity;
|
|
|
|
class AuthCodeRepository implements AuthCodeRepositoryInterface
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity)
|
|
{
|
|
// Some logic to persist the auth code to a database
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function revokeAuthCode($codeId)
|
|
{
|
|
// Some logic to revoke the auth code in a database
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function isAuthCodeRevoked($codeId)
|
|
{
|
|
return false; // The auth code has not been revoked
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getNewAuthCode()
|
|
{
|
|
return new AuthCodeEntity();
|
|
}
|
|
}
|