From e5d76bb0a9b740899bff18db549975b7bfe089a6 Mon Sep 17 00:00:00 2001 From: Meleki Date: Tue, 3 Mar 2026 09:09:15 +0100 Subject: [PATCH] fix: credentials: include bei allen Telegram API-Requests --- wwwroot/js/api.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(); }