@@ -519,6 +519,10 @@ public function pageRegister(Request $request, Response $response, $args)
519519
520520 // Load validation rules
521521 $ schema = new RequestSchema ('schema://requests/register.yaml ' );
522+ $ schema ->set ('password.validators.length.min ' , $ config ['site.password.length.min ' ]);
523+ $ schema ->set ('password.validators.length.max ' , $ config ['site.password.length.max ' ]);
524+ $ schema ->set ('passwordc.validators.length.min ' , $ config ['site.password.length.min ' ]);
525+ $ schema ->set ('passwordc.validators.length.max ' , $ config ['site.password.length.max ' ]);
522526 $ validatorRegister = new JqueryValidationAdapter ($ schema , $ this ->ci ->translator );
523527
524528 // Get locale information
@@ -593,11 +597,18 @@ public function pageResendVerification(Request $request, Response $response, $ar
593597 */
594598 public function pageResetPassword (Request $ request , Response $ response , $ args )
595599 {
600+ /** @var \UserFrosting\Support\Repository\Repository $config */
601+ $ config = $ this ->ci ->config ;
602+
596603 // Insert the user's secret token from the link into the password reset form
597604 $ params = $ request ->getQueryParams ();
598605
599606 // Load validation rules - note this uses the same schema as "set password"
600607 $ schema = new RequestSchema ('schema://requests/set-password.yaml ' );
608+ $ schema ->set ('password.validators.length.min ' , $ config ['site.password.length.min ' ]);
609+ $ schema ->set ('password.validators.length.max ' , $ config ['site.password.length.max ' ]);
610+ $ schema ->set ('passwordc.validators.length.min ' , $ config ['site.password.length.min ' ]);
611+ $ schema ->set ('passwordc.validators.length.max ' , $ config ['site.password.length.max ' ]);
601612 $ validator = new JqueryValidationAdapter ($ schema , $ this ->ci ->translator );
602613
603614 return $ this ->ci ->view ->render ($ response , 'pages/reset-password.html.twig ' , [
@@ -627,11 +638,18 @@ public function pageResetPassword(Request $request, Response $response, $args)
627638 */
628639 public function pageSetPassword (Request $ request , Response $ response , $ args )
629640 {
641+ /** @var \UserFrosting\Support\Repository\Repository $config */
642+ $ config = $ this ->ci ->config ;
643+
630644 // Insert the user's secret token from the link into the password set form
631645 $ params = $ request ->getQueryParams ();
632646
633647 // Load validation rules
634648 $ schema = new RequestSchema ('schema://requests/set-password.yaml ' );
649+ $ schema ->set ('password.validators.length.min ' , $ config ['site.password.length.min ' ]);
650+ $ schema ->set ('password.validators.length.max ' , $ config ['site.password.length.max ' ]);
651+ $ schema ->set ('passwordc.validators.length.min ' , $ config ['site.password.length.min ' ]);
652+ $ schema ->set ('passwordc.validators.length.max ' , $ config ['site.password.length.max ' ]);
635653 $ validator = new JqueryValidationAdapter ($ schema , $ this ->ci ->translator );
636654
637655 return $ this ->ci ->view ->render ($ response , 'pages/set-password.html.twig ' , [
@@ -664,6 +682,9 @@ public function pageSetPassword(Request $request, Response $response, $args)
664682 */
665683 public function pageSettings (Request $ request , Response $ response , $ args )
666684 {
685+ /** @var \UserFrosting\Support\Repository\Repository $config */
686+ $ config = $ this ->ci ->config ;
687+
667688 /** @var \UserFrosting\Sprinkle\Account\Authorize\AuthorizationManager */
668689 $ authorizer = $ this ->ci ->authorizer ;
669690
@@ -677,14 +698,15 @@ public function pageSettings(Request $request, Response $response, $args)
677698
678699 // Load validation rules
679700 $ schema = new RequestSchema ('schema://requests/account-settings.yaml ' );
701+ $ schema ->set ('password.validators.length.min ' , $ config ['site.password.length.min ' ]);
702+ $ schema ->set ('password.validators.length.max ' , $ config ['site.password.length.max ' ]);
703+ $ schema ->set ('passwordc.validators.length.min ' , $ config ['site.password.length.min ' ]);
704+ $ schema ->set ('passwordc.validators.length.max ' , $ config ['site.password.length.max ' ]);
680705 $ validatorAccountSettings = new JqueryValidationAdapter ($ schema , $ this ->ci ->translator );
681706
682707 $ schema = new RequestSchema ('schema://requests/profile-settings.yaml ' );
683708 $ validatorProfileSettings = new JqueryValidationAdapter ($ schema , $ this ->ci ->translator );
684709
685- /** @var \UserFrosting\Support\Repository\Repository $config */
686- $ config = $ this ->ci ->config ;
687-
688710 // Get a list of all locales
689711 $ locales = $ config ->getDefined ('site.locales.available ' );
690712
@@ -919,6 +941,10 @@ public function register(Request $request, Response $response, $args)
919941
920942 // Load the request schema
921943 $ schema = new RequestSchema ('schema://requests/register.yaml ' );
944+ $ schema ->set ('password.validators.length.min ' , $ config ['site.password.length.min ' ]);
945+ $ schema ->set ('password.validators.length.max ' , $ config ['site.password.length.max ' ]);
946+ $ schema ->set ('passwordc.validators.length.min ' , $ config ['site.password.length.min ' ]);
947+ $ schema ->set ('passwordc.validators.length.max ' , $ config ['site.password.length.max ' ]);
922948
923949 // Whitelist and set parameter defaults
924950 $ transformer = new RequestDataTransformer ($ schema );
@@ -1117,6 +1143,10 @@ public function setPassword(Request $request, Response $response, $args)
11171143
11181144 // Load the request schema
11191145 $ schema = new RequestSchema ('schema://requests/set-password.yaml ' );
1146+ $ schema ->set ('password.validators.length.min ' , $ config ['site.password.length.min ' ]);
1147+ $ schema ->set ('password.validators.length.max ' , $ config ['site.password.length.max ' ]);
1148+ $ schema ->set ('passwordc.validators.length.min ' , $ config ['site.password.length.min ' ]);
1149+ $ schema ->set ('passwordc.validators.length.max ' , $ config ['site.password.length.max ' ]);
11201150
11211151 // Whitelist and set parameter defaults
11221152 $ transformer = new RequestDataTransformer ($ schema );
@@ -1210,6 +1240,10 @@ public function settings(Request $request, Response $response, $args)
12101240
12111241 // Load the request schema
12121242 $ schema = new RequestSchema ('schema://requests/account-settings.yaml ' );
1243+ $ schema ->set ('password.validators.length.min ' , $ config ['site.password.length.min ' ]);
1244+ $ schema ->set ('password.validators.length.max ' , $ config ['site.password.length.max ' ]);
1245+ $ schema ->set ('passwordc.validators.length.min ' , $ config ['site.password.length.min ' ]);
1246+ $ schema ->set ('passwordc.validators.length.max ' , $ config ['site.password.length.max ' ]);
12131247
12141248 // Whitelist and set parameter defaults
12151249 $ transformer = new RequestDataTransformer ($ schema );
0 commit comments