fix csrf token handling in controllers

This commit is contained in:
team 1
2026-02-18 08:52:19 +01:00
parent 0d3efa228d
commit 64b263c5fe

View File

@@ -234,7 +234,7 @@ class DocumentController extends AbstractController
): RedirectResponse ): RedirectResponse
{ {
if (!$this->isCsrfTokenValid('activate_version', $request->request->get('_token'))) { if (!$this->isCsrfTokenValid('activate_version_'.$versionId, $request->request->get('_token'))) {
throw $this->createAccessDeniedException(); throw $this->createAccessDeniedException();
} }
@@ -313,7 +313,7 @@ class DocumentController extends AbstractController
): ?RedirectResponse ): ?RedirectResponse
{ {
$dryRun = false; $dryRun = false;
if (!$this->isCsrfTokenValid('ingest_version', $request->request->get('_token'))) { if (!$this->isCsrfTokenValid('ingest_version_'.$versionId, $request->request->get('_token'))) {
throw $this->createAccessDeniedException(); throw $this->createAccessDeniedException();
} }
@@ -427,7 +427,7 @@ class DocumentController extends AbstractController
LockService $lockService, LockService $lockService,
): RedirectResponse ): RedirectResponse
{ {
if (!$this->isCsrfTokenValid('delete_document', $request->request->get('_token'))) { if (!$this->isCsrfTokenValid('delete_document_' . $id, $request->request->get('_token'))) {
throw $this->createAccessDeniedException(); throw $this->createAccessDeniedException();
} }