Restrict API access for free/unpaid accounts

This commit is contained in:
David Bomba 2021-11-10 08:23:22 +11:00
parent 075fe7a5e5
commit d0be8f744c

View File

@ -42,6 +42,16 @@ class TokenAuth
return response()->json($error, 403);
}
if(Ninja::isHosted() && $company_token->is_system == 0 && !$user->account->isPaid()){
$error = [
'message' => 'Feature not available with free / unpaid account.',
'errors' => new stdClass,
];
return response()->json($error, 403);
}
/*
|
| Necessary evil here: As we are authenticating on CompanyToken,