This commit intends to address a situation where the module config
settings are set to not use the Username field (i.e. ‘useUsername’ =>
false) and a user is trying to use the login/register via email feature.
previously, trying to load the User from the post would fail when
useUsername is set to false because there are no User fields on the
form for Yii to load.
This change should fix the issue by not trying to load the User from
the post, but rather only setting the $user->username if the module
settings call for using the username field.
This commit intends to address a situation where the module config settings are set to not use the Username field (i.e. ‘useUsername’ => false) and a user is trying to use the login/register via email feature.