Skip to content

Commit

Permalink
Also check if CSRF token is a string (0 or 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
melroy89 authored Sep 13, 2024
1 parent 3067ba9 commit 00e5731
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ 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, with ID: $id");
$isTokenAString = \is_string($token);
throw new BadRequestHttpException("Invalid CSRF token, with ID: $id. Is token a string?: $isTokenAString");
}
}

Expand Down

0 comments on commit 00e5731

Please sign in to comment.