Commit a0600c86 by Yvon

loginlistener should only perform session operations if login is from remember me token

parent aaf91c73
...@@ -23,12 +23,15 @@ class LoginListener ...@@ -23,12 +23,15 @@ class LoginListener
public function onSecurityInteractiveLogin(InteractiveLoginEvent $event) public function onSecurityInteractiveLogin(InteractiveLoginEvent $event)
{ {
$tokenName = (string) $event->getAuthenticationToken();
if(strpos($tokenName,"RememberMeToken") !== false) {
$user = $event->getAuthenticationToken()->getUser(); $user = $event->getAuthenticationToken()->getUser();
if ($user->getGroups()->count() > 0) { if ($user->getGroups()->count() > 0) {
$groupe = $user->getGroups()->first(); $groupe = $user->getGroups()->first();
$this->updateSessionGroup($user, $groupe); $this->updateSessionGroup($user, $groupe);
} }
} }
}
private function updateSessionGroup(UserInterface $user, Usergroup $groupe) private function updateSessionGroup(UserInterface $user, Usergroup $groupe)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment