You are here

public function OauthController::logout in Media: Acquia DAM 8

Redirects the user to the auth url.

Route: /acquiadam/logout.

1 string reference to 'OauthController::logout'
media_acquiadam.routing.yml in ./media_acquiadam.routing.yml
media_acquiadam.routing.yml

File

src/Controller/OauthController.php, line 179

Class

OauthController
Controller routines for acquiadam routes.

Namespace

Drupal\media_acquiadam\Controller

Code

public function logout() {
  $this->userData
    ->delete('media_acquiadam', $this->currentUser
    ->id(), 'acquiadam_access_token');
  $this->userData
    ->delete('media_acquiadam', $this->currentUser
    ->id(), 'acquiadam_access_token_expiration');
  $this->userData
    ->delete('media_acquiadam', $this->currentUser
    ->id(), 'acquiadam_refresh_token');
  $authFinishRedirect = $this->request->query
    ->get('auth_finish_redirect');
  return new TrustedRedirectResponse($authFinishRedirect);
}