fix: ensure flash message is displayed after redirect

This commit is contained in:
Björn Fromme
2026-03-16 12:00:55 +01:00
parent e1bfe9b93c
commit 3d1b75b591
@@ -140,10 +140,11 @@ class IndexController extends AbstractController
$request->getSession()->remove('_security.main.target_path'); $request->getSession()->remove('_security.main.target_path');
// Redirect to account dashboard if logged in, otherwise to return URL // Redirect to account dashboard if logged in, otherwise to return URL
// Use htmxRedirect to ensure full page navigation so flash messages are displayed
if (null !== $this->getUser()) { if (null !== $this->getUser()) {
$this->addFlash('info', 'Buchung abgebrochen.'); $this->addFlash('info', 'Buchung abgebrochen.');
return $this->redirectToRoute('app_account'); return $this->htmxRedirect($request, $this->generateUrl('app_account'));
} }
// Use htmxRedirect for cross-origin safety (returnUrl may be external) // Use htmxRedirect for cross-origin safety (returnUrl may be external)