Bolt\Controller\Base::isCsrfTokenValid PHP Method

isCsrfTokenValid() protected method

Check if csrf token is valid.
protected isCsrfTokenValid ( string | null $value = null, string $id = 'bolt' ) : boolean
$value string | null The token value or null to use "bolt_csrf_token" parameter from request.
$id string The token ID.
return boolean
    protected function isCsrfTokenValid($value = null, $id = 'bolt')
    {
        $token = new CsrfToken($id, $value ?: $this->app['request_stack']->getCurrentRequest()->get('bolt_csrf_token'));
        return $this->app['csrf']->isTokenValid($token);
    }