fix: ensure flash message is displayed after redirect

This commit is contained in:
Björn Fromme
2025-12-09 12:55:23 +01:00
parent 31f414b4d8
commit 150998e120
@@ -140,10 +140,11 @@ class IndexController extends AbstractController
$request->getSession()->remove('_security.main.target_path');
// 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()) {
$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)