Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hafezdivandari committed Aug 22, 2024
1 parent 3556921 commit 84d9d4a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Bridge/AccessTokenRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getNewToken(
*/
public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity): void
{
Passport::token()->create([
Passport::token()->newQuery()->create([
'id' => $id = $accessTokenEntity->getIdentifier(),
'user_id' => $userId = $accessTokenEntity->getUserIdentifier(),
'client_id' => $clientId = $accessTokenEntity->getClient()->getIdentifier(),
Expand Down Expand Up @@ -73,6 +73,6 @@ public function revokeAccessToken(string $tokenId): void
*/
public function isAccessTokenRevoked(string $tokenId): bool
{
return Passport::token()->whereKey($tokenId)->where('revoked', false)->doesntExist();
return Passport::token()->newQuery()->whereKey($tokenId)->where('revoked', false)->doesntExist();
}
}
6 changes: 3 additions & 3 deletions src/Bridge/RefreshTokenRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getNewRefreshToken(): ?RefreshTokenEntityInterface
*/
public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntity): void
{
Passport::refreshToken()->create([
Passport::refreshToken()->newQuery()->create([
'id' => $id = $refreshTokenEntity->getIdentifier(),
'access_token_id' => $accessTokenId = $refreshTokenEntity->getAccessToken()->getIdentifier(),
'revoked' => false,
Expand All @@ -51,14 +51,14 @@ public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshToken
*/
public function revokeRefreshToken(string $tokenId): void
{
Passport::refreshToken()->whereKey($tokenId)->update(['revoked' => true]);
Passport::refreshToken()->newQuery()->whereKey($tokenId)->update(['revoked' => true]);
}

/**
* {@inheritdoc}
*/
public function isRefreshTokenRevoked(string $tokenId): bool
{
return Passport::refreshToken()->whereKey($tokenId)->where('revoked', false)->doesntExist();
return Passport::refreshToken()->newQuery()->whereKey($tokenId)->where('revoked', false)->doesntExist();
}
}
2 changes: 1 addition & 1 deletion src/PersonalAccessTokenFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected function dispatchRequestToAuthorizationServer(ServerRequestInterface $
*/
public function findAccessToken(array $response)
{
return Passport::token()->find(
return Passport::token()->newQuery()->find(
$this->jwt->parse($response['access_token'])->claims()->get('jti')
);
}
Expand Down

0 comments on commit 84d9d4a

Please sign in to comment.