fix: credentials: include bei allen Telegram API-Requests

This commit is contained in:
Meleki committed 2026-03-03 09:09:15 +01:00
1 parent 4ac042e512
commit e5d76bb0a9
1 file changed
+4 -2
+4 -2
View File
@@ -264,6 +264,7 @@ async function apiTelegramStatus() {
async function apiTelegramLink(sessionId) { async function apiTelegramLink(sessionId) {
const resp = await fetch('/api/telegram/link', { const resp = await fetch('/api/telegram/link', {
method: 'POST', method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ sessionId }) body: JSON.stringify({ sessionId })
}); });
@@ -275,7 +276,7 @@ async function apiTelegramLink(sessionId) {
} }
async function apiTelegramWebhookInfo() { 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'); if (!resp.ok) throw new Error('Webhook-Info fehlgeschlagen');
return resp.json(); return resp.json();
} }
@@ -283,6 +284,7 @@ async function apiTelegramWebhookInfo() {
async function apiTelegramRegisterWebhook(baseUrl) { async function apiTelegramRegisterWebhook(baseUrl) {
const resp = await fetch('/api/telegram/register-webhook', { const resp = await fetch('/api/telegram/register-webhook', {
method: 'POST', method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ baseUrl }) body: JSON.stringify({ baseUrl })
}); });
@@ -291,7 +293,7 @@ async function apiTelegramRegisterWebhook(baseUrl) {
} }
async function apiTelegramDeleteWebhook() { 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'); if (!resp.ok) throw new Error('Webhook-Löschung fehlgeschlagen');
return resp.json(); return resp.json();
} }