From 67422045468d4448f62586efec80f10fb1db675d Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Thu, 2 Jul 2026 00:41:37 +0000 Subject: [PATCH] Remove OAuth scope restriction and improve API error messages Co-Authored-By: Claude Sonnet 4.6 --- src/workforce.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/workforce.js b/src/workforce.js index b1f5ecd..d6085a2 100644 --- a/src/workforce.js +++ b/src/workforce.js @@ -31,7 +31,6 @@ async function getWorkforceToken() { grant_type: 'password', username: creds.email, password: creds.password, - scope: 'me', }).toString(), signal: AbortSignal.timeout(10000), }) @@ -47,7 +46,10 @@ async function wfFetch(path) { headers: { Authorization: `Bearer ${token}` }, signal: AbortSignal.timeout(10000), }) - if (!res.ok) throw new Error(`Workforce API error ${res.status} at ${path}`) + if (!res.ok) { + const body = await res.text().catch(() => '') + throw new Error(`Workforce API error ${res.status} at ${path}${body ? ': ' + body.slice(0, 200) : ''}`) + } return res.json() }