You are here

public function OAuth2Storage::unsetRefreshToken in OAuth2 Server 8

Same name and namespace in other branches
  1. 2.0.x src/OAuth2Storage.php \Drupal\oauth2_server\OAuth2Storage::unsetRefreshToken()

Unset refresh token.

Parameters

string $refresh_token: The refresh token string.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

\Drupal\Core\Entity\EntityStorageException

File

src/OAuth2Storage.php, line 899

Class

OAuth2Storage
Provides Drupal OAuth2 storage for the library.

Namespace

Drupal\oauth2_server

Code

public function unsetRefreshToken($refresh_token) {

  /** @var \Drupal\oauth2_server\TokenInterface $token */
  $token = $this
    ->getStorageToken($refresh_token);

  // Check token exists before trying to delete.
  if ($token) {
    $token
      ->delete();
  }
}