Request department and staff scopes in Workforce connection test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-02 00:55:17 +00:00
parent ed6a978a48
commit a6627ee763

View file

@ -92,7 +92,7 @@ export async function integrationRoutes(app) {
const res = await fetch(`${baseUrl}/api/oauth/token`, { const res = await fetch(`${baseUrl}/api/oauth/token`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({ grant_type: 'password', username: creds.email, password: creds.password }).toString(), body: new URLSearchParams({ grant_type: 'password', username: creds.email, password: creds.password, scope: 'me department staff' }).toString(),
signal: AbortSignal.timeout(8000), signal: AbortSignal.timeout(8000),
}) })
if (!res.ok) throw new Error(`Workforce auth failed (${res.status})`) if (!res.ok) throw new Error(`Workforce auth failed (${res.status})`)