@@ -40,19 +40,29 @@ public function getRegistrationRules(): array
4040 helper ('setting ' );
4141
4242 return setting ('Validation.registration ' ) ?? [
43- 'username ' => $ usernameValidationRules ,
44- 'email ' => $ emailValidationRules ,
45- 'password ' => [
46- 'label ' => 'Auth.password ' ,
47- 'rules ' => 'required| ' . Passwords::getMaxLengthRule () . '|strong_password[] ' ,
48- 'errors ' => [
49- 'max_byte ' => 'Auth.errorPasswordTooLongBytes ' ,
50- ],
51- ],
52- 'password_confirm ' => [
53- 'label ' => 'Auth.passwordConfirm ' ,
54- 'rules ' => 'required|matches[password] ' ,
43+ 'username ' => $ usernameValidationRules ,
44+ 'email ' => $ emailValidationRules ,
45+ 'password ' => $ this ->getPasswordRules (),
46+ 'password_confirm ' => $ this ->getPasswordConfirmRules (),
47+ ];
48+ }
49+
50+ public function getPasswordRules (): array
51+ {
52+ return [
53+ 'label ' => 'Auth.password ' ,
54+ 'rules ' => 'required| ' . Passwords::getMaxLengthRule () . '|strong_password[] ' ,
55+ 'errors ' => [
56+ 'max_byte ' => 'Auth.errorPasswordTooLongBytes ' ,
5557 ],
5658 ];
5759 }
60+
61+ public function getPasswordConfirmRules (): array
62+ {
63+ return [
64+ 'label ' => 'Auth.passwordConfirm ' ,
65+ 'rules ' => 'required|matches[password] ' ,
66+ ];
67+ }
5868}
0 commit comments