. // }}} /** * 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\RefreshTokenEntityInterface; use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface; use Plugin\OAuth2\Entity; class RefreshToken implements RefreshTokenRepositoryInterface { public function persistNewRefreshToken(RefreshtokenEntityInterface $refreshtokenEntity) { DB::persist($refreshtokenEntity); } public function revokeRefreshToken($tokenId) { // Some logic to revoke the auth token in a database } public function isRefreshtokenRevoked($tokenId) { return false; // The auth token has not been revoked } public function getNewRefreshToken() { return new Entity\RefreshToken(); } }