Archived
1
0
Fork 0
This repository has been archived on 2023-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
ts3web/src/Control/Actions/AuthLogoutAction.php

19 lines
No EOL
561 B
PHP

<?php
use Slim\Http\Request;
use Slim\Http\Response;
final class AuthLogoutAction extends AbstractAction
{
public function __invoke(Request $request, Response $response, $args)
{
$this->flash->addMessage('success', $this->translator->trans('logout.flash.success'));
$this->ts->login($this->auth->getIdentity()['user'], $this->auth->getIdentity()['password']);
$this->ts->getInstance()->logout();
$this->auth->logout();
$this->session->clear();
return $response->withRedirect('/login');
}
}