working leantime widget 49

This commit is contained in:
Alma 2025-04-12 15:13:48 +02:00
parent bc9c2dbe1f
commit f6fa3bccaf

View File

@ -21,11 +21,14 @@ async function getLeantimeUserId(email: string): Promise<number | null> {
}
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',