Skip to content

Commit eaedd25

Browse files
committed
fix: wrong password validation rules for login
1 parent 0ea5110 commit eaedd25

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Validation/ValidationRules.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,13 @@ public function getRegistrationRules(): array
4646
[sprintf('is_unique[%s.secret]', $this->tables['identities'])]
4747
);
4848

49+
$passwordRules = $this->getPasswordRules();
50+
$passwordRules['rules'][] = 'strong_password[]';
51+
4952
return [
5053
'username' => $usernameValidationRules,
5154
'email' => $emailValidationRules,
52-
'password' => $this->getPasswordRules(),
55+
'password' => $passwordRules,
5356
'password_confirm' => $this->getPasswordConfirmRules(),
5457
];
5558
}
@@ -69,7 +72,7 @@ public function getPasswordRules(): array
6972
{
7073
return [
7174
'label' => 'Auth.password',
72-
'rules' => 'required|' . Passwords::getMaxLengthRule() . '|strong_password[]',
75+
'rules' => ['required', Passwords::getMaxLengthRule()],
7376
'errors' => [
7477
'max_byte' => 'Auth.errorPasswordTooLongBytes',
7578
],

0 commit comments

Comments
 (0)