You are here

public function AuthController::logout in Auth0 Single Sign On 8

Same name and namespace in other branches
  1. 8.2 src/Controller/AuthController.php \Drupal\auth0\Controller\AuthController::logout()

Handles the login page override.

1 string reference to 'AuthController::logout'
auth0.routing.yml in ./auth0.routing.yml
auth0.routing.yml

File

src/Controller/AuthController.php, line 113

Class

AuthController
Controller routines for auth0 authentication.

Namespace

Drupal\auth0\Controller

Code

public function logout() {
  global $base_root;
  $auth0Api = new Authentication($this->domain, $this->client_id);
  user_logout();

  // if we are using SSO, we need to logout completely from Auth0, otherwise they will just logout of their client
  return new TrustedRedirectResponse($auth0Api
    ->get_logout_link($base_root, $this->redirect_for_sso ? null : $this->client_id));
}