public function AuthController::logout in Auth0 Single Sign On 8.2
Same name and namespace in other branches
- 8 src/Controller/AuthController.php \Drupal\auth0\Controller\AuthController::logout()
Handles the login page override.
Return value
\Drupal\Core\Routing\TrustedRedirectResponse The response after logout.
1 string reference to 'AuthController::logout'
File
- src/
Controller/ AuthController.php, line 296 - Contains \Drupal\auth0\Controller\AuthController.
Class
- AuthController
- Controller routines for auth0 authentication.
Namespace
Drupal\auth0\ControllerCode
public function logout() {
$auth0Api = new Authentication($this->helper
->getAuthDomain(), $this->clientId);
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(\Drupal::request()
->getSchemeAndHttpHost(), $this->redirectForSso ? NULL : $this->clientId));
}