Skip to content

Commit

Permalink
Merge pull request #501 from kenjis/improve-RegisterController-allowe…
Browse files Browse the repository at this point in the history
…dPostFields

fix: set only validated fields to User Entity in RegisterController
  • Loading branch information
kenjis authored Nov 5, 2022
2 parents fc01d3a + 33cc6d3 commit 7e90fda
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Controllers/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,8 @@ public function registerAction(): RedirectResponse
}

// Save the user
$allowedPostFields = array_merge(
setting('Auth.validFields'),
setting('Auth.personalFields'),
array_keys($rules),
);
$user = $this->getUserEntity();
$allowedPostFields = array_keys($rules);
$user = $this->getUserEntity();
$user->fill($this->request->getPost($allowedPostFields));

// Workaround for email only registration/login
Expand Down

0 comments on commit 7e90fda

Please sign in to comment.