Release 2.16 (#4780)

This commit is contained in:
Kevin Papst
2024-05-01 14:24:24 +02:00
committed by GitHub
parent 8f8d228fb3
commit 99c296a751
150 changed files with 2498 additions and 1905 deletions

View File

@@ -0,0 +1,41 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\EventSubscriber;
use App\Security\SessionHandler;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Security\Http\Event\LogoutEvent;
final class LogoutSubscriber implements EventSubscriberInterface
{
public function __construct(
private readonly SessionHandler $sessionHandler,
private readonly LoggerInterface $logger
)
{
}
public static function getSubscribedEvents(): array
{
return [
LogoutEvent::class => 'onLogout',
];
}
public function onLogout(LogoutEvent $event): void
{
try {
$this->sessionHandler->garbageCollection();
} catch (\Exception $exception) {
$this->logger->error('Failed removing expired session: ' . $exception->getMessage());
}
}
}