Skip to content

Commit

Permalink
Merge pull request #49 from mweimerskirch/patch-3
Browse files Browse the repository at this point in the history
Fix WordPress login hook
  • Loading branch information
eko committed Oct 24, 2014
2 parents 0c28175 + bb48d8b commit 391e19d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Event/Hook/UserHookListener.php
Expand Up @@ -78,10 +78,11 @@ public function onLogin(WordpressEvent $event)
$user = $this->userManager->find($wpUser->data->ID);
$user->setWordpressRoles($wpUser->roles);

$token = new UsernamePasswordToken($user, $user->getPass(), 'secured_area', $user->getRoles());
$firewall = 'secured_area';
$token = new UsernamePasswordToken($user, $user->getPass(), $firewall, $user->getRoles());
$this->securityContext->setToken($token);

$this->session->set('token', $token);
$this->session->set('_security_' . $firewall, serialize($token));
}

/**
Expand Down

0 comments on commit 391e19d

Please sign in to comment.