feat: require an api key to schedule

This commit is contained in:
2026-06-08 15:54:05 +01:00
parent a0bff2beb1
commit 458b7897dd
5 changed files with 53 additions and 3 deletions
+4
View File
@@ -42,6 +42,8 @@ function handle_get(): never
function handle_post(): never
{
require_api_key();
$body = json_body();
$templateId = (int) ($body['template_id'] ?? 0);
$mode = (string) ($body['mode'] ?? '');
@@ -104,6 +106,8 @@ function handle_post(): never
function handle_put(): never
{
require_api_key();
$id = (int) ($_GET['id'] ?? 0);
if ($id <= 0) {
error_out('Missing or invalid id');