Skip to content

Commit b981f15

Browse files
weaverryanfabpot
authored andcommitted
[quick_tour] Upgrading the CSRF configuration to the new format.
1 parent f129945 commit b981f15

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

quick_tour/the_architecture.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ PHP. Have a look at the default configuration:
171171
app.config:
172172
charset: UTF-8
173173
error_handler: null
174-
csrf_secret: xxxxxxxxxx
174+
csrf_protection:
175+
enabled: true
176+
secret: xxxxxxxxxx
175177
router: { resource: "%kernel.root_dir%/config/routing.yml" }
176178
validation: { enabled: true, annotations: true }
177179
templating:
@@ -203,10 +205,11 @@ PHP. Have a look at the default configuration:
203205
.. code-block:: xml
204206
205207
<!-- app/config/config.xml -->
206-
<app:config csrf-secret="xxxxxxxxxx" charset="UTF-8" error-handler="null">
208+
<app:config charset="UTF-8" error-handler="null">
207209
<app:router resource="%kernel.root_dir%/config/routing.xml" />
208210
<app:validation enabled="true" annotations="true" />
209211
<app:session default-locale="en" lifetime="3600" />
212+
<app:csrf-protection enabled="true" secret="xxxxxxxxxx" />
210213
</app:config>
211214
212215
<!-- Twig Configuration -->
@@ -235,12 +238,12 @@ PHP. Have a look at the default configuration:
235238
236239
// app/config/config.php
237240
$container->loadFromExtension('app', 'config', array(
238-
'charset' => 'UTF-8',
239-
'error_handler' => null,
240-
'csrf-secret' => 'xxxxxxxxxx',
241-
'router' => array('resource' => '%kernel.root_dir%/config/routing.php'),
242-
'validation' => array('enabled' => true, 'annotations' => true),
243-
'templating' => array(
241+
'charset' => 'UTF-8',
242+
'error_handler' => null,
243+
'csrf-protection' => array('enabled' => true, 'secret' => 'xxxxxxxxxx'),
244+
'router' => array('resource' => '%kernel.root_dir%/config/routing.php'),
245+
'validation' => array('enabled' => true, 'annotations' => true),
246+
'templating' => array(
244247
#'assets_version' => "SomeVersionScheme",
245248
),
246249
'session' => array(

0 commit comments

Comments
 (0)