mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 11:48:05 +00:00
Disable API endpoints.
This commit is contained in:
@@ -29,6 +29,7 @@ use FireflyIII\Models\Webhook;
|
||||
use FireflyIII\Repositories\Webhook\WebhookRepositoryInterface;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Class SubmitController
|
||||
@@ -56,6 +57,10 @@ class SubmitController extends Controller
|
||||
*/
|
||||
public function submit(Webhook $webhook): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
|
||||
Log::channel('audit')->info(sprintf('User submits webhook #%d', $webhook->id));
|
||||
// count messages that can be sent.
|
||||
$messages = $this->repository->getReadyMessages($webhook);
|
||||
|
Reference in New Issue
Block a user