Skip to content

Commit 2a8013a

Browse files
committed
Add AuthenticationTokenCreatedEvent to be propagated
1 parent 188036b commit 2a8013a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

DependencyInjection/Compiler/RegisterGlobalSecurityEventListenersPass.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\Security\Core\AuthenticationEvents;
1717
use Symfony\Component\Security\Core\Event\AuthenticationSuccessEvent;
18+
use Symfony\Component\Security\Http\Event\AuthenticationTokenCreatedEvent;
1819
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
1920
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
2021
use Symfony\Component\Security\Http\Event\LoginFailureEvent;
@@ -40,6 +41,7 @@ class RegisterGlobalSecurityEventListenersPass implements CompilerPassInterface
4041
LoginFailureEvent::class,
4142
LoginSuccessEvent::class,
4243
LogoutEvent::class,
44+
AuthenticationTokenCreatedEvent::class,
4345
AuthenticationSuccessEvent::class,
4446
InteractiveLoginEvent::class,
4547

Tests/DependencyInjection/Compiler/RegisterGlobalSecurityEventListenersPassTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
2222
use Symfony\Component\Security\Core\AuthenticationEvents;
2323
use Symfony\Component\Security\Core\Event\AuthenticationSuccessEvent;
24+
use Symfony\Component\Security\Http\Event\AuthenticationTokenCreatedEvent;
2425
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
2526
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
2627
use Symfony\Component\Security\Http\Event\LoginFailureEvent;
@@ -76,6 +77,7 @@ public function providePropagatedEvents(): array
7677
[LoginFailureEvent::class, LoginFailureEvent::class],
7778
[LoginSuccessEvent::class, LoginSuccessEvent::class],
7879
[LogoutEvent::class, LogoutEvent::class],
80+
[AuthenticationTokenCreatedEvent::class, AuthenticationTokenCreatedEvent::class],
7981
[AuthenticationEvents::AUTHENTICATION_SUCCESS, AuthenticationEvents::AUTHENTICATION_SUCCESS],
8082
[SecurityEvents::INTERACTIVE_LOGIN, SecurityEvents::INTERACTIVE_LOGIN],
8183

0 commit comments

Comments
 (0)