Update OAuth token request to use application/x-www-form-urlencoded content type

This commit is contained in:
Adam Iannazzone 2026-02-07 15:46:22 -05:00
parent 0a5dadb610
commit 651e2ae142

View file

@ -70,8 +70,8 @@ const server = http.createServer(async (req, res) => {
const tokenResponse = await fetch('https://opencollective.com/oauth/token', { const tokenResponse = await fetch('https://opencollective.com/oauth/token', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: JSON.stringify({ body: new URLSearchParams({
grant_type: 'authorization_code', grant_type: 'authorization_code',
client_id: CLIENT_ID, client_id: CLIENT_ID,
client_secret: CLIENT_SECRET, client_secret: CLIENT_SECRET,