You are here

public function AdminSettings::hubspotOauthDisconnect in HubSpot 8

Same name and namespace in other branches
  1. 3.x src/Form/AdminSettings.php \Drupal\hubspot\Form\AdminSettings::hubspotOauthDisconnect()

Deletes Hubspot OAuth tokens.

Parameters

array $form: Active form build.

\Drupal\Core\Form\FormStateInterface $form_state: Active form state.

File

src/Form/AdminSettings.php, line 255

Class

AdminSettings
Hubspot admin settings form.

Namespace

Drupal\hubspot\Form

Code

public function hubspotOauthDisconnect(array &$form, FormStateInterface $form_state) {
  $this
    ->messenger()
    ->addStatus($this
    ->t('Successfully disconnected from HubSpot.'), FALSE);
  $this->state
    ->delete('hubspot.hubspot_refresh_token');
}