fix: ensure flash message is displayed after redirect
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user