API fix for mobile app
This commit is contained in:
parent
9b8247b659
commit
8ba48d16be
1 changed files with 3 additions and 1 deletions
|
|
@ -71,7 +71,9 @@ class ApiCheck
|
|||
return $next($request);
|
||||
}
|
||||
|
||||
if (! Utils::hasFeature(FEATURE_API) && ! $hasApiSecret) {
|
||||
$isMobileApp = strpos(array_get($_SERVER, 'HTTP_USER_AGENT'), '(dart:io)') !== false;
|
||||
|
||||
if (! Utils::hasFeature(FEATURE_API) && ! $hasApiSecret && ! $isMobileApp) {
|
||||
$error['error'] = ['message' => 'API requires pro plan'];
|
||||
|
||||
return Response::json($error, 403, $headers);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue