eZ Community » Forums » eZ Publish 5 Platform » Missing form token from Request
expandshrink

Missing form token from Request

Missing form token from Request

Thursday 28 August 2014 6:01:58 pm - 3 replies

i got this error when i submit contact form or user subscribing form :An exception has been thrown during the rendering of a template ("Missing form token from Request"blunk.gif Emoticon .....

     csrf_protection:        enabled: true        # Note: changing this will break legacy extensions that rely on the default name to alter AJAX requests        # See https://jira.ez.no/browse/EZP-20783        field_name: ezxform_token

How can i fix that plz?

Thanks

Modified on Thursday 28 August 2014 6:06:20 pm by Youssef MEZZAT

Thursday 28 August 2014 6:37:02 pm

Hi,

there is a bit of ongoing work that might solve this for you:

https://github.com/ezsystems/ezpublish-kernel/pull/951
Patch:

https://github.com/ezsystems/ezpublish-kernel/pull/951.diff

Thursday 28 August 2014 7:31:23 pm

Hi André.

Thanks Ar that works.

Thanks a lot.

Tuesday 02 September 2014 4:42:00 pm

Hi,

right now i resolve all frotend form (object create or delete) using:

         $this->csrfProvider = $this->container->get('form.csrf_provider') ;
        $csrfToken = $this->csrfProvider->generateCsrfToken('legacy');

for frontend Login:

         $this->csrfProvider = $this->container->get('form.csrf_provider') ;
        $csrfToken = $this->csrfProvider->generateCsrfToken('authenticate');

legacy form like registration, password forgotten etc. is a lgacy stuff dont need noting.

For contact form an ezxform_token will be generated after given :

 {{ form_rest(form) }}

in the twig template.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from