mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Return error when the user isn't attached to a company
This commit is contained in:
parent
3fca12f970
commit
3b01190bc2
@ -207,6 +207,9 @@ class LoginController extends BaseController
|
||||
$cu = CompanyUser::query()
|
||||
->where('user_id', auth()->user()->id);
|
||||
|
||||
if(!$cu->exists())
|
||||
return response()->json(['message' => 'User not linked to any companies'], 403);
|
||||
|
||||
$cu->first()->account->companies->each(function ($company) use($cu, $request){
|
||||
|
||||
if($company->tokens()->where('is_system', true)->count() == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user