From 8761e9bd8479e288e44639eaa0b1ef62074c8a7c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Mon, 11 Dec 2023 05:48:15 +0100 Subject: [PATCH] Enable global csrf protection Migrate from bcrypt and plaintext to sodium --- Resources/config/packages/rapsys_blog.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Resources/config/packages/rapsys_blog.yaml b/Resources/config/packages/rapsys_blog.yaml index b57fc12..deae9f9 100644 --- a/Resources/config/packages/rapsys_blog.yaml +++ b/Resources/config/packages/rapsys_blog.yaml @@ -183,7 +183,7 @@ framework: headers: X-Originating-IP: '%env(REMOTE_ADDR)%' secret: '%env(APP_SECRET)%' - #csrf_protection: true + csrf_protection: true session: enabled: true handler_id: ~ @@ -200,8 +200,10 @@ security: #XXX: comment this key in config/security.yaml to prevent users_in_memory induced failures #TODO: see https://symfony.com/doc/current/security/passwords.html (sodium ? + upgrade) Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: - algorithm: 'bcrypt' + #Rapsys\BlogBundle\Entity\User: + algorithm: 'sodium' migrate_from: + - 'bcrypt' - 'plaintext' # Set providers @@ -248,7 +250,6 @@ security: # Password parameter password_parameter: 'login[password]' # Enable login csrf protection - #TODO: enable in framework now that it works here ? enable_csrf: false # Csrf parameter csrf_parameter: 'login[_token]' -- 2.41.1