Change how credentials are sent when requesting tokens

The preferred way to send the credentials is through the Authorization
header, ase documented on the Spotify Developer Site
(see https://developer.spotify.com/web-api/authorization-guide/#authorization_code_flow)
This commit is contained in:
JMPerez 2014-11-03 11:06:34 +01:00
parent d3f229bad3
commit 0464cf41ca

View file

@ -76,9 +76,10 @@ app.get('/callback', function(req, res) {
form: {
code: code,
redirect_uri: redirect_uri,
grant_type: 'authorization_code',
client_id: client_id,
client_secret: client_secret
grant_type: 'authorization_code'
},
headers: {
'Authorization': 'Basic ' + (new Buffer(client_id + ':' + client_secret).toString('base64'))
},
json: true
};