#347 Only pass fields that are known to be in the User Model
This commit is contained in:
@ -102,9 +102,14 @@ class RegistrationController extends Controller
|
|||||||
|
|
||||||
if ($form->load(Yii::$app->request->post()) && $form->validate()) {
|
if ($form->load(Yii::$app->request->post()) && $form->validate()) {
|
||||||
$this->trigger(FormEvent::EVENT_BEFORE_REGISTER, $event);
|
$this->trigger(FormEvent::EVENT_BEFORE_REGISTER, $event);
|
||||||
|
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user = $this->make(User::class, [], $form->attributes);
|
$user = $this->make(User::class, [],
|
||||||
$user->setScenario('register');
|
[ 'email' => $form->attributes['email'],
|
||||||
|
'username' => $form->attributes['username'],
|
||||||
|
'password' => $form->attributes['password']
|
||||||
|
]); $user->setScenario('register');
|
||||||
|
|
||||||
$mailService = MailFactory::makeWelcomeMailerService($user);
|
$mailService = MailFactory::makeWelcomeMailerService($user);
|
||||||
|
|
||||||
if ($this->make(UserRegisterService::class, [$user, $mailService])->run()) {
|
if ($this->make(UserRegisterService::class, [$user, $mailService])->run()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user