Skip to content

Commit 1ff83e0

Browse files
bug symfony#61614 [SecurityBundle] Prevent accessing the tracked token storage when collecting data (MatTheCat)
This PR was merged into the 6.4 branch. Discussion ---------- [SecurityBundle] Prevent accessing the tracked token storage when collecting data | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix symfony#61525 | License | MIT Commits ------- a27ba98 [SecurityBundle] Prevent accessing the tracked token storage when collecting data
2 parents e3b664d + a27ba98 commit 1ff83e0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,12 @@ public function collect(Request $request, Response $response, ?\Throwable $excep
106106
}
107107

108108
$logoutUrl = null;
109-
try {
110-
$logoutUrl = $this->logoutUrlGenerator?->getLogoutPath();
111-
} catch (\Exception) {
112-
// fail silently when the logout URL cannot be generated
109+
if ($this->logoutUrlGenerator && method_exists($token, 'getFirewallName')) {
110+
try {
111+
$logoutUrl = $this->logoutUrlGenerator->getLogoutPath($token->getFirewallName());
112+
} catch (\Exception) {
113+
// fail silently when the logout URL cannot be generated
114+
}
113115
}
114116

115117
$this->data = [

0 commit comments

Comments
 (0)