. // }}} /** * OAuth2 implementation for GNU social * * @package OAuth2 * @category API * * @author Diogo Peralta Cordeiro * @author Hugo Sales * @copyright 2022 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ namespace Plugin\OAuth2\Repository; use App\Core\DB\DB; use League\OAuth2\Server\Entities\AuthCodeEntityInterface; use League\OAuth2\Server\Repositories\AuthCodeRepositoryInterface; use Plugin\OAuth2\Entity; class AuthCode implements AuthCodeRepositoryInterface { public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity) { DB::persist($authCodeEntity); } public function revokeAuthCode($codeId) { // Some logic to revoke the auth code in a database } public function isAuthCodeRevoked($codeId) { return false; // The auth code has not been revoked } public function getNewAuthCode() { return new Entity\AuthCode(); } }