Skip to content

Commit f444d1f

Browse files
Merge branch '6.2' into 6.3
* 6.2: Fix merge [Translation] Fix handling of null messages in `ArrayLoader` [Console] Remove exec and replace it by shell_exec [Security] Skip clearing CSRF Token on stateless logout
2 parents 60fc42c + 22bc4bb commit f444d1f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

EventListener/CsrfTokenClearingLogoutListener.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1515
use Symfony\Component\Security\Csrf\TokenStorage\ClearableTokenStorageInterface;
16+
use Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage;
1617
use Symfony\Component\Security\Http\Event\LogoutEvent;
1718

1819
/**
@@ -31,6 +32,10 @@ public function __construct(ClearableTokenStorageInterface $csrfTokenStorage)
3132

3233
public function onLogout(LogoutEvent $event): void
3334
{
35+
if ($this->csrfTokenStorage instanceof SessionTokenStorage && !$event->getRequest()->hasPreviousSession()) {
36+
return;
37+
}
38+
3439
$this->csrfTokenStorage->clear();
3540
}
3641

0 commit comments

Comments
 (0)