From 281b29e1c10b872d9305c9429e49a74110e71cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Mielcarek?= Date: Tue, 28 May 2024 09:55:16 +0200 Subject: [PATCH] Change token recovery request from get to post --- callback-server/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/callback-server/app.js b/callback-server/app.js index 3d239ff..6a5074e 100644 --- a/callback-server/app.js +++ b/callback-server/app.js @@ -32,8 +32,12 @@ app.post('/', async (req, res) => { const code = req.query.code; const authOptions = { - url: 'https://accounts.spotify.com/api/token', method: 'get', json: true, - data: { code: code, redirect_uri: redirectUri, grant_type: 'authorization_code' }, + url: 'https://accounts.spotify.com/api/token', method: 'post', json: true, + data: { + code: code, + redirect_uri: redirectUri, + grant_type: 'authorization_code' + }, headers: { 'content-type': 'application/x-www-form-urlencoded', 'Authorization': 'Basic ' + (new Buffer.from(clientId + ':' + clientSecret).toString('base64'))