Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve invalid CSRF token logging + add explicit dependency #1130

Merged
merged 7 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading