Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bc2c171

Browse filesBrowse files
committed
Fix high-deps tests
1 parent 2a2174e commit bc2c171
Copy full SHA for bc2c171

File tree

2 files changed

+15
-5
lines changed
Filter options

2 files changed

+15
-5
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Authenticator/Debug/TraceableAuthenticator.php
+1-1Lines changed: 1 addition & 1 deletion
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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Authenticator/Debug/TraceableAuthenticatorManagerListener.php
+14-4Lines changed: 14 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.