CSRF token

The CSRF token design area tells the system to print a special token used for authenticating JS API calls made from the current page.

This design area is the recommended way to let the JS API perform CSRF protection.

If this design area is not present, you may get prompted with a CSRF token error when trying to load the Edit+ interface or making JS API function calls from the front end. For more information, please consult your server administrator.

You need to print the design area somewhere inside the <body> tag, preferably directly after its opening tag. For example:

<body>
    <mysource_area id_name="csrf_token" design_area="csrf_token"/>

This will print a hidden input element on the front end which the JS API looks for when it does any API requests:

<body>
   <input type="hidden" name="token" value="010c61d630bde283d2ca1ed8d21b9277359e67ae" class="sq-form-field" id="token" />

© 2015- Squiz Pty Ltd