diff --git a/src/routes/integrations.js b/src/routes/integrations.js index c664791..d3cff8a 100644 --- a/src/routes/integrations.js +++ b/src/routes/integrations.js @@ -91,8 +91,8 @@ export async function integrationRoutes(app) { const baseUrl = creds.base_url || 'https://my.workforce.com' const res = await fetch(`${baseUrl}/api/oauth/token`, { method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ grant_type: 'password', username: creds.email, password: creds.password, scope: 'default' }), + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: new URLSearchParams({ grant_type: 'password', username: creds.email, password: creds.password, scope: 'me' }).toString(), signal: AbortSignal.timeout(8000), }) if (!res.ok) throw new Error(`Workforce auth failed (${res.status})`)