/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Security/Http/Exception/InvalidCsrfTokenException.php
30 строк
961 B
eltharin
[Security] Throw a forbidden exception when the IsCsrfTokenValid attribute fails
26 июл 2026, 23:16
26 июл 2026, 23:16
c261d97
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Http\Exception; use Symfony\Component\HttpKernel\Exception\HttpException; /** * Thrown when the CSRF token checked by the #[IsCsrfTokenValid] attribute is invalid. * * Unlike its Security\Core counterpart, which reports an authentication failure, this one * reports a forbidden request: the controller is reached by an already identified caller. * * @author Roman JOLY <eltharin18@outlook.fr> */ class InvalidCsrfTokenException extends HttpException { public function __construct(string $message = 'Invalid CSRF token.', ?\Throwable $previous = null, int $code = 0, array $headers = []) { parent::__construct(403, $message, $previous, $headers, $code); } }