Skip to content

Commit 77408fc

Browse files
authored
feature #1405 [make:reset-password] increase password strength & check for comprimised password
1 parent b0d2d5d commit 77408fc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Maker/MakeResetPassword.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
use Symfony\Component\Translation\Translator;
5454
use Symfony\Component\Validator\Constraints\Length;
5555
use Symfony\Component\Validator\Constraints\NotBlank;
56+
use Symfony\Component\Validator\Constraints\NotCompromisedPassword;
57+
use Symfony\Component\Validator\Constraints\PasswordStrength;
5658
use Symfony\Component\Validator\Validation;
5759
use Symfony\Component\Yaml\Yaml;
5860
use Symfony\Contracts\Translation\TranslatorInterface;
@@ -292,6 +294,8 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
292294
OptionsResolver::class,
293295
Length::class,
294296
NotBlank::class,
297+
NotCompromisedPassword::class,
298+
PasswordStrength::class,
295299
]);
296300

297301
$generator->generateClass(

src/Resources/skeleton/resetPassword/ChangePasswordFormType.tpl.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
2222
'message' => 'Please enter a password',
2323
]),
2424
new Length([
25-
'min' => 6,
25+
'min' => 12,
2626
'minMessage' => 'Your password should be at least {{ limit }} characters',
2727
// max length allowed by Symfony for security reasons
2828
'max' => 4096,
2929
]),
30+
new PasswordStrength(),
31+
new NotCompromisedPassword(),
3032
],
3133
'label' => 'New password',
3234
],

0 commit comments

Comments
 (0)