mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Prevent connected accounts being linked to existing users
This commit is contained in:
parent
8bec600fdf
commit
bc5b9ca2e6
@ -104,8 +104,13 @@ class ConnectedAccountController extends BaseController
|
||||
$refresh_token = '';
|
||||
$token = '';
|
||||
|
||||
$email = $google->harvestEmail($user);
|
||||
|
||||
if(auth()->user()->email != $email && MultiDB::checkUserEmailExists($email))
|
||||
return response()->json(['message' => ctrans('texts.email_already_register')], 400)
|
||||
|
||||
$connected_account = [
|
||||
'email' => $google->harvestEmail($user),
|
||||
'email' => $email,
|
||||
'oauth_user_id' => $google->harvestSubField($user),
|
||||
'oauth_provider_id' => 'google',
|
||||
'email_verified_at' =>now()
|
||||
|
Loading…
Reference in New Issue
Block a user