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
223
223
*/
224
224
public array $ validFields = [
225
225
'email ' ,
226
- 'username ' ,
226
+ // 'username',
227
227
];
228
228
229
229
/**
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public function registerAction(): RedirectResponse
79
79
$ allowedPostFields = array_merge (
80
80
setting ('Auth.validFields ' ),
81
81
setting ('Auth.personalFields ' ),
82
- [ ' password ' ]
82
+ array_keys ( $ rules ),
83
83
);
84
84
$ user = $ this ->getUserEntity ();
85
85
$ user ->fill ($ this ->request ->getPost ($ allowedPostFields ));
Original file line number Diff line number Diff line change @@ -118,6 +118,11 @@ public function testLoginActionUsernameSuccess(): void
118
118
{
119
119
Time::setTestNow ('March 10, 2017 ' , 'America/Chicago ' );
120
120
121
+ // Add 'username' to $validFields
122
+ $ authConfig = config ('Auth ' );
123
+ $ authConfig ->validFields [] = 'username ' ;
124
+ Factories::injectMock ('config ' , 'Auth ' , $ authConfig );
125
+
121
126
// Change the validation rules
122
127
$ config = new class () extends Validation {
123
128
public $ login = [
You can’t perform that action at this time.
0 commit comments