Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0c32783

Browse files
committed
do not overwrite already stored tokens (i.e. from the session)
1 parent 07a891f commit 0c32783

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Security/Http/Authenticator/AbstractPreAuthenticatedAuthenticator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ abstract protected function extractUsername(Request $request): ?string;
5959

6060
public function supports(Request $request): ?bool
6161
{
62+
// do not overwrite already stored tokens (i.e. from the session)
63+
if (null !== $this->tokenStorage->getToken()) {
64+
return false;
65+
}
66+
6267
try {
6368
$username = $this->extractUsername($request);
6469
} catch (BadCredentialsException $e) {

0 commit comments

Comments
 (0)