improve csrf handling (#2936)

This commit is contained in:
Kevin Papst
2021-11-16 10:17:26 +01:00
committed by GitHub
parent a1992494d3
commit 95796ab256
15 changed files with 122 additions and 34 deletions

View File

@@ -209,7 +209,7 @@ final class PermissionController extends AbstractController
public function deleteRole(Role $role, string $csrfToken, UserRepository $userRepository, CsrfTokenManagerInterface $csrfTokenManager): Response
{
if (!$this->isCsrfTokenValid(self::TOKEN_NAME, $csrfToken)) {
$this->flashUpdateException(new \Exception('Invalid CSRF token'));
$this->flashError('action.csrf.error');
return $this->redirectToRoute('admin_user_permissions');
}