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::
148
148
149
149
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
150
150
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;
153
152
154
153
/**
155
154
* Stores the locale of the user in the session after the
@@ -164,19 +163,19 @@ event::
164
163
$this->requestStack = $requestStack;
165
164
}
166
165
167
- public function onInteractiveLogin(InteractiveLoginEvent $event)
166
+ public function onLoginSuccess(LoginSuccessEvent $event): void
168
167
{
169
- $user = $event->getAuthenticationToken()-> getUser();
168
+ $user = $event->getUser();
170
169
171
170
if (null !== $user->getLocale()) {
172
171
$this->requestStack->getSession()->set('_locale', $user->getLocale());
173
172
}
174
173
}
175
174
176
- public static function getSubscribedEvents()
175
+ public static function getSubscribedEvents(): array
177
176
{
178
177
return [
179
- SecurityEvents::INTERACTIVE_LOGIN => 'onInteractiveLogin ',
178
+ LoginSuccessEvent::class => 'onLoginSuccess ',
180
179
];
181
180
}
182
181
}
You can’t perform that action at this time.
0 commit comments