mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-04 08:54:33 +08:00
Updated social auth to take name from email if empty
- Added tests to cover. Fixes #1853
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user