mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Handle edge case where removed user tries to log into the system
This commit is contained in:
parent
d9ec77003d
commit
352a1fc1c0
@ -217,6 +217,9 @@ class LoginController extends BaseController
|
|||||||
$cu = CompanyUser::query()
|
$cu = CompanyUser::query()
|
||||||
->where('user_id', auth()->user()->id);
|
->where('user_id', auth()->user()->id);
|
||||||
|
|
||||||
|
if($cu->count() == 0)
|
||||||
|
return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400);
|
||||||
|
|
||||||
$truth = app()->make(TruthSource::class);
|
$truth = app()->make(TruthSource::class);
|
||||||
|
|
||||||
$truth->setCompanyUser($cu->first());
|
$truth->setCompanyUser($cu->first());
|
||||||
|
@ -43,38 +43,6 @@ class InvoiceInvitation extends BaseModel
|
|||||||
return self::class;
|
return self::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function getSignatureDateAttribute($value)
|
|
||||||
// {
|
|
||||||
// if (!$value) {
|
|
||||||
// return (new Carbon($value))->format('Y-m-d');
|
|
||||||
// }
|
|
||||||
// return $value;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public function getSentDateAttribute($value)
|
|
||||||
// {
|
|
||||||
// if (!$value) {
|
|
||||||
// return (new Carbon($value))->format('Y-m-d');
|
|
||||||
// }
|
|
||||||
// return $value;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public function getViewedDateAttribute($value)
|
|
||||||
// {
|
|
||||||
// if (!$value) {
|
|
||||||
// return (new Carbon($value))->format('Y-m-d');
|
|
||||||
// }
|
|
||||||
// return $value;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public function getOpenedDateAttribute($value)
|
|
||||||
// {
|
|
||||||
// if (!$value) {
|
|
||||||
// return (new Carbon($value))->format('Y-m-d');
|
|
||||||
// }
|
|
||||||
// return $value;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public function entityType()
|
public function entityType()
|
||||||
{
|
{
|
||||||
return Invoice::class;
|
return Invoice::class;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user