diff options
author | Nicolas Grekas <nicolas.grekas@gmail.com> | 2016-07-17 15:54:30 +0200 |
---|---|---|
committer | Nicolas Grekas <nicolas.grekas@gmail.com> | 2016-07-17 15:54:30 +0200 |
commit | e00948e5ae59fb98477b8b9868aa00646e8d5e23 (patch) | |
tree | bb7ecbea0980ae3febc529d1c10ba89be68040d8 /Http/Authentication | |
parent | dd90bbf0b3e20d7d09171fe74ac746a49d690aca (diff) | |
parent | d46dc33fbe1f845398e90e36410965e8de71075c (diff) | |
download | symfony-security-e00948e5ae59fb98477b8b9868aa00646e8d5e23.zip symfony-security-e00948e5ae59fb98477b8b9868aa00646e8d5e23.tar.gz symfony-security-e00948e5ae59fb98477b8b9868aa00646e8d5e23.tar.bz2 |
Merge branch '2.8' into 3.0v3.0.9origin/3.0
* 2.8:
[VarDumper] Fix dumping jsons casted as arrays
PassConfig::getMergePass is not an array
Revert "bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas)"
Fix the retrieval of the last username when using forwarding
[Yaml] Fix PHPDoc of the Yaml class
[HttpFoundation] Add OPTIONS and TRACE to the list of safe methods
Update getAbsoluteUri() for query string uris
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); } |