mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-30 22:54:32 -04:00
Fixes for OAuth using logging in over user/pass combinations
This commit is contained in:
parent
0f3495a245
commit
c5a24fd9d9
@ -405,6 +405,20 @@ class LoginController extends BaseController
|
|||||||
'oauth_user_id' => $google->harvestSubField($user),
|
'oauth_user_id' => $google->harvestSubField($user),
|
||||||
'oauth_provider_id'=> 'google',
|
'oauth_provider_id'=> 'google',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
$cu = CompanyUser::query()
|
||||||
|
->where('user_id', auth()->user()->id);
|
||||||
|
|
||||||
|
$cu->first()->account->companies->each(function ($company) use($cu){
|
||||||
|
|
||||||
|
if($company->tokens()->where('is_system', true)->count() == 0)
|
||||||
|
{
|
||||||
|
CreateCompanyToken::dispatchNow($company, $cu->first()->user, request()->server('HTTP_USER_AGENT'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return $this->timeConstrainedResponse($cu);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user