File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -148,8 +148,7 @@ event::
148148
149149 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
150150 use Symfony\Component\HttpFoundation\RequestStack;
151- use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
152- use Symfony\Component\Security\Http\SecurityEvents;
151+ use Symfony\Component\Security\Http\Event\LoginSuccessEvent;
153152
154153 /**
155154 * Stores the locale of the user in the session after the
@@ -164,19 +163,19 @@ event::
164163 $this->requestStack = $requestStack;
165164 }
166165
167- public function onInteractiveLogin(InteractiveLoginEvent $event)
166+ public function onLoginSuccess(LoginSuccessEvent $event): void
168167 {
169- $user = $event->getAuthenticationToken()-> getUser();
168+ $user = $event->getUser();
170169
171170 if (null !== $user->getLocale()) {
172171 $this->requestStack->getSession()->set('_locale', $user->getLocale());
173172 }
174173 }
175174
176- public static function getSubscribedEvents()
175+ public static function getSubscribedEvents(): array
177176 {
178177 return [
179- SecurityEvents::INTERACTIVE_LOGIN => 'onInteractiveLogin ',
178+ LoginSuccessEvent::class => 'onLoginSuccess ',
180179 ];
181180 }
182181 }
You can’t perform that action at this time.
0 commit comments