diff options
author | Christophe Coevoet <stof@notk.org> | 2016-07-11 11:55:50 +0200 |
---|---|---|
committer | Christophe Coevoet <stof@notk.org> | 2016-07-11 11:55:50 +0200 |
commit | f2589f884f36fb6a5fbb678d9a4e1db1384efeff (patch) | |
tree | b86ae796108684b9fa0754c1616c4e5e3f933e44 /Http/Authentication | |
parent | b3409eca8afc51fb67f47854b087f994f5a4c67b (diff) | |
download | symfony-security-f2589f884f36fb6a5fbb678d9a4e1db1384efeff.zip symfony-security-f2589f884f36fb6a5fbb678d9a4e1db1384efeff.tar.gz symfony-security-f2589f884f36fb6a5fbb678d9a4e1db1384efeff.tar.bz2 |
Fix the retrieval of the last username when using forwarding
Diffstat (limited to 'Http/Authentication')
-rw-r--r-- | Http/Authentication/AuthenticationUtils.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Http/Authentication/AuthenticationUtils.php b/Http/Authentication/AuthenticationUtils.php index 4d5c71a..c6397e8 100644 --- a/Http/Authentication/AuthenticationUtils.php +++ b/Http/Authentication/AuthenticationUtils.php @@ -65,7 +65,13 @@ class AuthenticationUtils */ 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); } |