Skip to content

Commit

Permalink
fix: cannot register when you remove email from $validFields
Browse files Browse the repository at this point in the history
"$user->id is null. You should not use the incomplete User object."
  • Loading branch information
kenjis committed Sep 13, 2023
1 parent 529d2fa commit e9e0a45
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Authentication/Passwords/ValidationRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ protected function buildUserFromData(array $data = []): User
*/
protected function prepareValidFields(): array
{
$config = config('Auth');
$fields = array_merge($config->validFields, $config->personalFields);
$fields[] = 'password';
$config = config('Auth');
$fields = array_merge($config->validFields, $config->personalFields, ['email', 'password']);

return $fields;
return array_unique($fields);
}
}

0 comments on commit e9e0a45

Please sign in to comment.