We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5922d71 commit e041365Copy full SHA for e041365
src/Symfony/Component/Security/Http/Authentication/AuthenticationUtils.php
@@ -65,7 +65,13 @@ public function getLastAuthenticationError($clearSession = true)
65
*/
66
public function getLastUsername()
67
{
68
- $session = $this->getRequest()->getSession();
+ $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();
75
76
return null === $session ? '' : $session->get(Security::LAST_USERNAME);
77
}
0 commit comments