Skip to content

Commit c9316d3

Browse files
94nonichalasr
authored andcommitted
[SecurityBundle] Fix listing listeners in profiler when authenticator manager is disabled
1 parent 4b68568 commit c9316d3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

DataCollector/SecurityDataCollector.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,15 @@ public function collect(Request $request, Response $response, \Throwable $except
194194
'access_denied_handler' => $firewallConfig->getAccessDeniedHandler(),
195195
'access_denied_url' => $firewallConfig->getAccessDeniedUrl(),
196196
'user_checker' => $firewallConfig->getUserChecker(),
197-
'authenticators' => $firewallConfig->getAuthenticators(),
198197
];
199198

199+
// in 6.0, always fill `$this->data['authenticators'] only
200+
if ($this->authenticatorManagerEnabled) {
201+
$this->data['authenticators'] = $firewallConfig->getAuthenticators();
202+
} else {
203+
$this->data['listeners'] = $firewallConfig->getAuthenticators();
204+
}
205+
200206
// generate exit impersonation path from current request
201207
if ($this->data['impersonated'] && null !== $switchUserConfig = $firewallConfig->getSwitchUser()) {
202208
$exitPath = $request->getRequestUri();

Security/FirewallConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function getAccessDeniedUrl(): ?string
113113
}
114114

115115
/**
116-
* @deprecated since Symfony 5.4, use {@see getListeners()} instead
116+
* @deprecated since Symfony 5.4, use {@see getAuthenticators()} instead
117117
*/
118118
public function getListeners(): array
119119
{

0 commit comments

Comments
 (0)