File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ class Auth extends BaseConfig
223223 */
224224 public array $ validFields = [
225225 'email ' ,
226- 'username ' ,
226+ // 'username',
227227 ];
228228
229229 /**
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public function registerAction(): RedirectResponse
7979 $ allowedPostFields = array_merge (
8080 setting ('Auth.validFields ' ),
8181 setting ('Auth.personalFields ' ),
82- [ ' password ' ]
82+ array_keys ( $ rules ),
8383 );
8484 $ user = $ this ->getUserEntity ();
8585 $ user ->fill ($ this ->request ->getPost ($ allowedPostFields ));
Original file line number Diff line number Diff line change @@ -118,6 +118,11 @@ public function testLoginActionUsernameSuccess(): void
118118 {
119119 Time::setTestNow ('March 10, 2017 ' , 'America/Chicago ' );
120120
121+ // Add 'username' to $validFields
122+ $ authConfig = config ('Auth ' );
123+ $ authConfig ->validFields [] = 'username ' ;
124+ Factories::injectMock ('config ' , 'Auth ' , $ authConfig );
125+
121126 // Change the validation rules
122127 $ config = new class () extends Validation {
123128 public $ login = [
You can’t perform that action at this time.
0 commit comments