Skip to content

Commit bc2c171

Browse files
committed
Fix high-deps tests
1 parent 2a2174e commit bc2c171

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/Symfony/Component/Security/Http/Authenticator/Debug/TraceableAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*/
3131
final class TraceableAuthenticator implements AuthenticatorInterface, InteractiveAuthenticatorInterface, AuthenticationEntryPointInterface
3232
{
33-
private ?bool $supports;
33+
private ?bool $supports = false;
3434
private ?Passport $passport = null;
3535
private ?float $duration = null;
3636
private ClassStub|string $stub;

src/Symfony/Component/Security/Http/Authenticator/Debug/TraceableAuthenticatorManagerListener.php

+14-4
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,22 @@ public function supports(Request $request): ?bool
3434
{
3535
$supports = $this->authenticationManagerListener->supports($request);
3636

37-
foreach (array_merge($request->attributes->get('_security_skipped_authenticators'), $request->attributes->get('_security_authenticators')) as $authenticator) {
38-
if ($authenticator instanceof TraceableAuthenticator) {
39-
$this->authenticators[] = $authenticator;
40-
}
37+
foreach($request->attributes->get('_security_skipped_authenticators') as $authenticator) {
38+
$this->authenticators[] = $authenticator instanceof TraceableAuthenticator
39+
? $authenticator
40+
: new TraceableAuthenticator($authenticator)
41+
;
4142
}
4243

44+
$supportedAuthenticators = [];
45+
foreach ($request->attributes->get('_security_authenticators') as $authenticator) {
46+
$this->authenticators[] = $supportedAuthenticators[] = $authenticator instanceof TraceableAuthenticator
47+
? $authenticator :
48+
new TraceableAuthenticator($authenticator)
49+
;
50+
}
51+
$request->attributes->set('_security_authenticators', $supportedAuthenticators);
52+
4353
return $supports;
4454
}
4555

0 commit comments

Comments
 (0)