Skip to content

Commit

Permalink
Fix the retrieval of the last username when using forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Jul 11, 2016
1 parent 5922d71 commit e041365
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -65,7 +65,13 @@ public function getLastAuthenticationError($clearSession = true)
*/
public function getLastUsername()
{
$session = $this->getRequest()->getSession();
$request = $this->getRequest();

if ($request->attributes->has(Security::LAST_USERNAME)) {
return $request->attributes->get(Security::LAST_USERNAME);
}

$session = $request->getSession();

return null === $session ? '' : $session->get(Security::LAST_USERNAME);
}
Expand Down

0 comments on commit e041365

Please sign in to comment.