Validation fails

This commit is contained in:
Frank
2026-01-10 00:25:57 +01:00
parent 490f730c97
commit ac4c5ef261
6 changed files with 27 additions and 23 deletions

View File

@@ -13,6 +13,7 @@ framework:
cookie_secure: auto cookie_secure: auto
cookie_samesite: lax cookie_samesite: lax
storage_factory_id: session.storage.factory.native storage_factory_id: session.storage.factory.native
save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
#esi: true #esi: true
#fragments: true #fragments: true

View File

@@ -9,4 +9,6 @@ opcache.validate_timestamps=1
opcache.revalidate_freq=0 opcache.revalidate_freq=0
log_errors=On 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

View File

@@ -1,9 +1,18 @@
<?php <?php
use App\Kernel; use App\Kernel;
use Symfony\Component\HttpFoundation\Request;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php'; require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) { return function (array $context) {
if ($trustedProxies = $context['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT);
}
if ($trustedHosts = $context['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts([$trustedHosts]);
}
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
}; };

View File

@@ -26,15 +26,13 @@ class ChangePasswordFormType extends AbstractType
], ],
'first_options' => [ 'first_options' => [
'constraints' => [ 'constraints' => [
new NotBlank([ new NotBlank(message: 'Please enter a password'),
'message' => 'Please enter a password', new Length(
]), min: 12,
new Length([ minMessage: 'Your password should be at least {{ limit }} characters',
'min' => 12,
'minMessage' => 'Your password should be at least {{ limit }} characters',
// max length allowed by Symfony for security reasons // max length allowed by Symfony for security reasons
'max' => 4096, max: 4096,
]), ),
new PasswordStrength(), new PasswordStrength(),
new NotCompromisedPassword(), new NotCompromisedPassword(),
], ],

View File

@@ -21,9 +21,7 @@ class RegistrationFormType extends AbstractType
->add('email', EmailType::class) ->add('email', EmailType::class)
->add('username', TextType::class, [ ->add('username', TextType::class, [
'constraints' => [ 'constraints' => [
new NotBlank([ new NotBlank(message: 'Please enter a username'),
'message' => 'Please enter a username',
]),
], ],
]) ])
->add('plainPassword', RepeatedType::class, [ ->add('plainPassword', RepeatedType::class, [
@@ -33,15 +31,13 @@ class RegistrationFormType extends AbstractType
'first_options' => ['label' => 'Password'], 'first_options' => ['label' => 'Password'],
'second_options' => ['label' => 'Repeat Password'], 'second_options' => ['label' => 'Repeat Password'],
'constraints' => [ 'constraints' => [
new NotBlank([ new NotBlank(message: 'Please enter a password'),
'message' => 'Please enter a password', new Length(
]), min: 6,
new Length([ minMessage: 'Your password should be at least {{ limit }} characters',
'min' => 6,
'minMessage' => 'Your password should be at least {{ limit }} characters',
// max length allowed by Symfony for security reasons // max length allowed by Symfony for security reasons
'max' => 4096, max: 4096,
]), ),
], ],
]) ])
; ;

View File

@@ -16,9 +16,7 @@ class ResetPasswordRequestFormType extends AbstractType
->add('email', EmailType::class, [ ->add('email', EmailType::class, [
'attr' => ['autocomplete' => 'email'], 'attr' => ['autocomplete' => 'email'],
'constraints' => [ 'constraints' => [
new NotBlank([ new NotBlank(message: 'Please enter your email'),
'message' => 'Please enter your email',
]),
], ],
]) ])
; ;