From ac4c5ef261e63478939bc4b5a12f258cca8b4c75 Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 10 Jan 2026 00:25:57 +0100 Subject: [PATCH] Validation fails --- config/packages/framework.yaml | 1 + docker/php/php.ini | 4 +++- public/index.php | 9 +++++++++ src/Tech/Form/ChangePasswordFormType.php | 14 ++++++-------- src/Tech/Form/RegistrationFormType.php | 18 +++++++----------- src/Tech/Form/ResetPasswordRequestFormType.php | 4 +--- 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 2bbc987..49e7c57 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -13,6 +13,7 @@ framework: cookie_secure: auto cookie_samesite: lax storage_factory_id: session.storage.factory.native + save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%' #esi: true #fragments: true diff --git a/docker/php/php.ini b/docker/php/php.ini index 5fd77c0..78ff47d 100644 --- a/docker/php/php.ini +++ b/docker/php/php.ini @@ -9,4 +9,6 @@ opcache.validate_timestamps=1 opcache.revalidate_freq=0 log_errors=On -error_log=/var/www/html/var/log/error_log.log +error_log=/var/www/html/var/log/errorlog_php.txt +session.gc_maxlifetime=1440 +session.cookie_lifetime=0 diff --git a/public/index.php b/public/index.php index 9982c21..89cccd2 100644 --- a/public/index.php +++ b/public/index.php @@ -1,9 +1,18 @@ [ 'constraints' => [ - new NotBlank([ - 'message' => 'Please enter a password', - ]), - new Length([ - 'min' => 12, - 'minMessage' => 'Your password should be at least {{ limit }} characters', + new NotBlank(message: 'Please enter a password'), + new Length( + min: 12, + minMessage: 'Your password should be at least {{ limit }} characters', // max length allowed by Symfony for security reasons - 'max' => 4096, - ]), + max: 4096, + ), new PasswordStrength(), new NotCompromisedPassword(), ], diff --git a/src/Tech/Form/RegistrationFormType.php b/src/Tech/Form/RegistrationFormType.php index 1120017..8bee2ce 100644 --- a/src/Tech/Form/RegistrationFormType.php +++ b/src/Tech/Form/RegistrationFormType.php @@ -21,9 +21,7 @@ class RegistrationFormType extends AbstractType ->add('email', EmailType::class) ->add('username', TextType::class, [ 'constraints' => [ - new NotBlank([ - 'message' => 'Please enter a username', - ]), + new NotBlank(message: 'Please enter a username'), ], ]) ->add('plainPassword', RepeatedType::class, [ @@ -33,15 +31,13 @@ class RegistrationFormType extends AbstractType 'first_options' => ['label' => 'Password'], 'second_options' => ['label' => 'Repeat Password'], 'constraints' => [ - new NotBlank([ - 'message' => 'Please enter a password', - ]), - new Length([ - 'min' => 6, - 'minMessage' => 'Your password should be at least {{ limit }} characters', + new NotBlank(message: 'Please enter a password'), + new Length( + min: 6, + minMessage: 'Your password should be at least {{ limit }} characters', // max length allowed by Symfony for security reasons - 'max' => 4096, - ]), + max: 4096, + ), ], ]) ; diff --git a/src/Tech/Form/ResetPasswordRequestFormType.php b/src/Tech/Form/ResetPasswordRequestFormType.php index 26f51a4..706068c 100644 --- a/src/Tech/Form/ResetPasswordRequestFormType.php +++ b/src/Tech/Form/ResetPasswordRequestFormType.php @@ -16,9 +16,7 @@ class ResetPasswordRequestFormType extends AbstractType ->add('email', EmailType::class, [ 'attr' => ['autocomplete' => 'email'], 'constraints' => [ - new NotBlank([ - 'message' => 'Please enter your email', - ]), + new NotBlank(message: 'Please enter your email'), ], ]) ;