| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | #[AsEventListener(event: LogoutEvent::class)] |
||
| 21 | public function onLogout(LogoutEvent $event): void |
||
| 22 | { |
||
| 23 | $identity = $this->security->getUser()->getIdentity(); |
||
| 24 | |||
| 25 | $logoutRedirectUrl = $this->logoutRedirectUrl[$identity->preferredLocale]; |
||
| 26 | |||
| 27 | $event->getRequest()->getSession()->invalidate(); |
||
| 28 | |||
| 29 | $response = new RedirectResponse($logoutRedirectUrl); |
||
| 30 | |||
| 31 | $event->setResponse($response); |
||
| 32 | } |
||
| 34 |