You are here

public function AutologoutController::altLogout in Automated Logout 8

Alternative logout.

1 string reference to 'AutologoutController::altLogout'
autologout.routing.yml in ./autologout.routing.yml
autologout.routing.yml

File

src/Controller/AutologoutController.php, line 64

Class

AutologoutController
Returns responses for autologout module routes.

Namespace

Drupal\autologout\Controller

Code

public function altLogout() {
  $this->autoLogoutManager
    ->logout();
  $redirect_url = $this
    ->config('autologout.settings')
    ->get('redirect_url');
  $url = Url::fromUserInput($redirect_url, [
    'absolute' => TRUE,
    'query' => [
      'autologout_timeout' => 1,
    ],
  ]);
  return new RedirectResponse($url
    ->toString());
}