Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 74436c4

Browse files
committed
Revert some changes
1 parent 06e6d8e commit 74436c4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

session/locale_sticky_session.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,20 +139,22 @@ want to use this as the locale for the given user. To accomplish this,
139139
you can hook into the login process and update the user's session with this
140140
locale value before they are redirected to their first page.
141141

142-
To do this, you need an event listener on the ``security.interactive_login``
142+
To do this, you need an event subscriber on the ``security.interactive_login``
143143
event::
144144

145145
// src/EventSubscriber/UserLocaleListener.php
146146
namespace App\EventSubscriber;
147147

148+
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
148149
use Symfony\Component\HttpFoundation\Session\SessionInterface;
149150
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
151+
use Symfony\Component\Security\Http\SecurityEvents;
150152

151153
/**
152154
* Stores the locale of the user in the session after the
153155
* login. This can be used by the LocaleSubscriber afterwards.
154156
*/
155-
class UserLocaleListener
157+
class UserLocaleSubscriber implements EventSubscriberInterface
156158
{
157159
private $session;
158160

0 commit comments

Comments
 (0)