File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -134,8 +134,10 @@ event:
134
134
// src/AppBundle/EventListener/UserLocaleListener.php
135
135
namespace AppBundle\EventListener;
136
136
137
+ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
137
138
use Symfony\Component\HttpFoundation\Session\Session;
138
139
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
140
+ use Symfony\Component\Security\Http\SecurityEvents;
139
141
140
142
/**
141
143
* Stores the locale of the user in the session after the
@@ -164,6 +166,13 @@ event:
164
166
$this->session->set('_locale', $user->getLocale());
165
167
}
166
168
}
169
+
170
+ public static function getSubscribedEvents()
171
+ {
172
+ return array(
173
+ SecurityEvents::INTERACTIVE_LOGIN => array(array('onInteractiveLogin', 15)),
174
+ );
175
+ }
167
176
}
168
177
169
178
Then register the listener:
You can’t perform that action at this time.
0 commit comments