1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Improve efficiency of login routes

This commit is contained in:
David Bomba 2024-03-21 12:03:17 +11:00
parent 200ed28e31
commit 2ef9856b41

View File

@ -390,6 +390,7 @@ class LoginController extends BaseController
$truth->setUser($user);
$truth->setCompany($set_company);
//21-03-2024
$cu->each(function ($cu){
if(CompanyToken::where('company_id', $cu->company_id)->where('user_id', $cu->user_id)->where('is_system', true)->doesntExist()){
(new CreateCompanyToken($cu->company, $cu->user, request()->server('HTTP_USER_AGENT')))->handle();