From f6fa3bccaf89283e43ae0eb3266968d9bc3b8466 Mon Sep 17 00:00:00 2001 From: Alma Date: Sat, 12 Apr 2025 15:13:48 +0200 Subject: [PATCH] working leantime widget 49 --- app/api/leantime/tasks/route.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/api/leantime/tasks/route.ts b/app/api/leantime/tasks/route.ts index f4a9bc0d..eff2e612 100644 --- a/app/api/leantime/tasks/route.ts +++ b/app/api/leantime/tasks/route.ts @@ -21,11 +21,14 @@ async function getLeantimeUserId(email: string): Promise { } console.log('Fetching Leantime users for email:', email); + console.log('API URL:', process.env.LEANTIME_API_URL); + console.log('Token length:', process.env.LEANTIME_TOKEN.length); + const response = await fetch(`${process.env.LEANTIME_API_URL}/api/jsonrpc`, { method: 'POST', headers: { 'Content-Type': 'application/json', - 'apiKey': process.env.LEANTIME_TOKEN + 'Authorization': `Bearer ${process.env.LEANTIME_TOKEN}` }, body: JSON.stringify({ jsonrpc: '2.0', @@ -97,7 +100,7 @@ export async function GET(request: NextRequest) { method: 'POST', headers: { 'Content-Type': 'application/json', - 'apiKey': process.env.LEANTIME_TOKEN + 'Authorization': `Bearer ${process.env.LEANTIME_TOKEN}` }, body: JSON.stringify({ jsonrpc: '2.0',