Updated social auth to take name from email if empty

- Added tests to cover.

Fixes #1853
This commit is contained in:
Dan Brown
2020-03-10 19:09:22 +00:00
parent ccf92331c2
commit 59aefe5371
2 changed files with 59 additions and 21 deletions

View File

@ -123,6 +123,11 @@ class SocialController extends Controller
'password' => Str::random(32)
];
// Take name from email address if empty
if (!$userData['name']) {
$userData['name'] = explode('@', $userData['email'])[0];
}
$user = $this->registrationService->registerUser($userData, $socialAccount, $emailVerified);
auth()->login($user);