8000 [Security] Display authenticators in the profiler even if they are al… · symfony/symfony@9712441 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9712441

Browse files
committed
[Security] Display authenticators in the profiler even if they are all skipped
1 parent 678abb4 commit 9712441

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/Symfony/Component/Security/Http/Authentication/AuthenticatorManager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,13 @@ public function supports(Request $request): ?bool
108108
}
109109
}
110110

111+
$request->attributes->set('_security_skipped_authenticators', $skippedAuthenticators);
112+
111113
if (!$authenticators) {
112114
return false;
113115
}
114116

115117
$request->attributes->set('_security_authenticators', $authenticators);
116-
$request->attributes->set('_security_skipped_authenticators', $skippedAuthenticators);
117118

118119
return $lazy ? null : true;
119120
}

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,7 @@ public function __construct(
3636

3737
public function supports(Request $request): ?bool
3838
{
39-
return $this->authenticationManagerListener->supports($request);
40-
}
41-
42-
public function authenticate(RequestEvent $event): void
43-
{
44-
$request = $event->getRequest();
45-
46-
if (!$authenticators = $request->attributes->get('_security_authenticators')) {
47-
return;
48-
}
39+
$supports = $this->authenticationManagerListener->supports($request);
4940

5041
foreach ($request->attributes->get('_security_skipped_authenticators') as $skippedAuthenticator) {
5142
$this->authenticatorsInfo[] = [
@@ -58,7 +49,18 @@ public function authenticate(RequestEvent $event): void
5849
];
5950
}
6051

61-
foreach ($authenticators as $key => $authenticator) {
52+
return $supports;
53+
}
54+
55+
public function authenticate(RequestEvent $event): void
56+
{
57+
$request = $event->getRequest();
58+
59+
if (!$authenticators = $request->attributes->get('_security_authenticators')) {
60+
return;
61+
}
62+
63+
foreach ($request->attributes->get('_security_authenticators') as $key => $authenticator) {
6264
$authenticators[$key] = new TraceableAuthenticator($authenticator);
6365
}
6466

0 commit comments

Comments
 (0)
0