<?php
namespace App\EventSubscriber;
use App\Manager\PendingNotificationManager;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
class PendingNotificationLoginSubscriber implements EventSubscriberInterface
{
public function __construct(
private readonly PendingNotificationManager $pendingNotificationManager,
) {
}
public static function getSubscribedEvents(): array
{
return [
InteractiveLoginEvent::class => 'onLogin',
];
}
public function onLogin(InteractiveLoginEvent $event): void
{
// Le front récupère la file via /api/notifications/pending pour afficher les toasts.
// Laisser la file intacte ici évite de la vider avant que le JS ne l'affiche.
}
}