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_samesite: lax
storage_factory_id: session.storage.factory.native
save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
#esi: true
#fragments: true

View File

@@ -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

View File

@@ -1,9 +1,18 @@
<?php
use App\Kernel;
use Symfony\Component\HttpFoundation\Request;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
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']);
};

View File

@@ -26,15 +26,13 @@ class ChangePasswordFormType extends AbstractType
],
'first_options' => [
'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(),
],

View File

@@ -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,
),
],
])
;

View File

@@ -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'),
],
])
;