Bolt\Controller\Base::validateCsrfToken PHP Méthode

validateCsrfToken() protected méthode

Validates CSRF token and throws HttpException if not.
protected validateCsrfToken ( string | null $value = null, string $id = 'bolt' )
$value string | null The token value or null to use "bolt_csrf_token" parameter from request.
$id string The token ID.
    protected function validateCsrfToken($value = null, $id = 'bolt')
    {
        if (!$this->isCsrfTokenValid($value, $id)) {
            //$this->app['logger.flash']->warning('The security token was incorrect. Please try again.');
            $this->abort(Response::HTTP_BAD_REQUEST, Trans::__('general.phrase.something-went-wrong'));
        }
    }