You are here

public function OauthTokenFileStorage::removeToken in Apigee Edge 8

File

src/OauthTokenFileStorage.php, line 206

Class

OauthTokenFileStorage
Stores OAuth token data in a file.

Namespace

Drupal\apigee_edge

Code

public function removeToken() : void {

  // Do not try to remove token from the token file if private filesystem
  // has not been configured yet. Also, do not create the token file
  // if it has not existed yet.
  if ($this
    ->isTokenFileInPrivateFileSystem() && (!$this
    ->isPrivateFileSystemConfigured() || $this
    ->isPrivateFileSystemConfigured() && !file_exists($this->tokenFilePath))) {
    $this->tokenData = [];
    return;
  }
  else {
    $this
      ->saveToken([]);
  }
}