From 4a15a5f07c19c136f4510b4e41b3094fee64191b Mon Sep 17 00:00:00 2001 From: Andrey Filippov Date: Tue, 9 Jul 2019 14:46:30 +0400 Subject: [PATCH 1/2] Fix auth codes table customization --- src/Bridge/AuthCodeRepository.php | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/Bridge/AuthCodeRepository.php b/src/Bridge/AuthCodeRepository.php index 012ea0c39..23410f4c7 100644 --- a/src/Bridge/AuthCodeRepository.php +++ b/src/Bridge/AuthCodeRepository.php @@ -11,24 +11,6 @@ class AuthCodeRepository implements AuthCodeRepositoryInterface { use FormatsScopesForStorage; - /** - * The database connection. - * - * @var \Illuminate\Database\Connection - */ - protected $database; - - /** - * Create a new repository instance. - * - * @param \Illuminate\Database\Connection $database - * @return void - */ - public function __construct(Connection $database) - { - $this->database = $database; - } - /** * {@inheritdoc} */ @@ -59,8 +41,7 @@ public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity) */ public function revokeAuthCode($codeId) { - $this->database->table(Passport::authCode()->getTable()) - ->where('id', $codeId)->update(['revoked' => true]); + Passport::authCode()->where('id', $codeId)->update(['revoked' => true]); } /** @@ -68,7 +49,6 @@ public function revokeAuthCode($codeId) */ public function isAuthCodeRevoked($codeId) { - return $this->database->table(Passport::authCode()->getTable()) - ->where('id', $codeId)->where('revoked', 1)->exists(); + return Passport::authCode()->where('id', $codeId)->where('revoked', 1)->exists(); } } From 649d747c224fd3042b16945db8d4db30619f8323 Mon Sep 17 00:00:00 2001 From: Andrey Filippov Date: Tue, 9 Jul 2019 14:58:00 +0400 Subject: [PATCH 2/2] Removed unused import --- src/Bridge/AuthCodeRepository.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Bridge/AuthCodeRepository.php b/src/Bridge/AuthCodeRepository.php index 23410f4c7..f3fb39d70 100644 --- a/src/Bridge/AuthCodeRepository.php +++ b/src/Bridge/AuthCodeRepository.php @@ -3,7 +3,6 @@ namespace Laravel\Passport\Bridge; use Laravel\Passport\Passport; -use Illuminate\Database\Connection; use League\OAuth2\Server\Entities\AuthCodeEntityInterface; use League\OAuth2\Server\Repositories\AuthCodeRepositoryInterface;