Skip to content

Commit

Permalink
Improve invalid CSRF token logging + add explicit dependency (#1130)
Browse files Browse the repository at this point in the history
  • Loading branch information
melroy89 authored Sep 16, 2024
1 parent 89c1334 commit 5aec5d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@
"symfony/runtime": "7.1.*",
"symfony/scheduler": "7.1.*",
"symfony/security-bundle": "7.1.*",
"symfony/security-csrf": "7.1.*",
"symfony/serializer": "7.1.*",
"symfony/string": "7.1.*",
"symfony/translation": "7.1.*",
"symfony/type-info": "7.1.*",
"symfony/twig-bundle": "7.1.*",
"symfony/type-info": "7.1.*",
"symfony/uid": "7.1.*",
"symfony/ux-autocomplete": "^2.18.0",
"symfony/ux-chartjs": "^2.18.0",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function getUserOrThrow(): User
protected function validateCsrf(string $id, $token): void
{
if (!\is_string($token) || !$this->isCsrfTokenValid($id, $token)) {
throw new BadRequestHttpException('Invalid CSRF token');
throw new BadRequestHttpException("Invalid CSRF token, with ID: $id.");
}
}

Expand Down

0 comments on commit 5aec5d8

Please sign in to comment.