Skip to content

Commit 33ab322

Browse files
Merge branch '3.1'
* 3.1: [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)" [Serializer] Include the format in the cache key 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 Conflicts: src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
2 parents 35cd497 + aaed0c7 commit 33ab322

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Authentication/AuthenticationUtils.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ public function getLastAuthenticationError($clearSession = true)
6565
*/
6666
public function getLastUsername()
6767
{
68-
$session = $this->getRequest()->getSession();
68+
$request = $this->getRequest();
69+
70+
if ($request->attributes->has(Security::LAST_USERNAME)) {
71+
return $request->attributes->get(Security::LAST_USERNAME);
72+
}
73+
74+
$session = $request->getSession();
6975

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

0 commit comments

Comments
 (0)