diff --git a/app/Http/Middleware/ApiCheck.php b/app/Http/Middleware/ApiCheck.php index 0d1c740889..80554c977a 100644 --- a/app/Http/Middleware/ApiCheck.php +++ b/app/Http/Middleware/ApiCheck.php @@ -28,7 +28,6 @@ class ApiCheck { $loggingIn = $request->is('api/v1/login') || $request->is('api/v1/register') - || $request->is('api/v1/ping') || $request->is('api/v1/oauth_login'); $headers = Utils::getApiHeaders(); @@ -55,6 +54,8 @@ class ApiCheck if ($token && $token->user) { Auth::onceUsingId($token->user_id); Session::set('token_id', $token->id); + } elseif ($hasApiSecret && $request->is('api/v1/ping')) { + // do nothing: allow ping with api_secret or account token } else { sleep(ERROR_DELAY); $error['error'] = ['message' => 'Invalid token'];