Restrict API access for free/unpaid accounts
This commit is contained in:
parent
075fe7a5e5
commit
d0be8f744c
1 changed files with 10 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue