You are here

public function OAuth2Client::clearToken in OAuth2 Client 8

Clear the token data from the session.

Overrides OAuth2ClientInterface::clearToken

1 call to OAuth2Client::clearToken()
OAuth2Client::getAccessToken in src/Service/OAuth2Client.php

File

src/Service/OAuth2Client.php, line 150

Class

OAuth2Client
OAuth2Client service.

Namespace

Drupal\oauth2_client\Service

Code

public function clearToken() {
  $tokens = $this->tempstore
    ->get('token');
  if (isset($tokens[$this->id])) {
    unset($tokens[$this->id]);
    $this->tempstore
      ->set('token', $tokens);
  }
  $this->token = [
    'access_token' => NULL,
    'expires_in' => NULL,
    'token_type' => NULL,
    'scope' => NULL,
    'refresh_token' => NULL,
    'expiration_time' => NULL,
  ];
}