diff --git a/wwwroot/js/api.js b/wwwroot/js/api.js index 81678be..8993285 100644 --- a/wwwroot/js/api.js +++ b/wwwroot/js/api.js @@ -264,6 +264,7 @@ async function apiTelegramStatus() { async function apiTelegramLink(sessionId) { const resp = await fetch('/api/telegram/link', { method: 'POST', + credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ sessionId }) }); @@ -275,7 +276,7 @@ async function apiTelegramLink(sessionId) { } async function apiTelegramWebhookInfo() { - const resp = await fetch('/api/telegram/webhook-info'); + const resp = await fetch('/api/telegram/webhook-info', { credentials: 'include' }); if (!resp.ok) throw new Error('Webhook-Info fehlgeschlagen'); return resp.json(); } @@ -283,6 +284,7 @@ async function apiTelegramWebhookInfo() { async function apiTelegramRegisterWebhook(baseUrl) { const resp = await fetch('/api/telegram/register-webhook', { method: 'POST', + credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ baseUrl }) }); @@ -291,7 +293,7 @@ async function apiTelegramRegisterWebhook(baseUrl) { } async function apiTelegramDeleteWebhook() { - const resp = await fetch('/api/telegram/webhook', { method: 'DELETE' }); + const resp = await fetch('/api/telegram/webhook', { method: 'DELETE', credentials: 'include' }); if (!resp.ok) throw new Error('Webhook-Löschung fehlgeschlagen'); return resp.json(); }