Skip to content

Instantly share code, notes, and snippets.

@KimGenius
Last active May 28, 2019 05:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KimGenius/16f15a89712af4c3f81c07ebb387c8ec to your computer and use it in GitHub Desktop.
Save KimGenius/16f15a89712af4c3f81c07ebb387c8ec to your computer and use it in GitHub Desktop.
const request = require('request-promise')
app.get('/authorize', (req, res) => {
const { code } = req.query
const result = await request({
method: 'POST',
uri: 'https://api.solapi.net/oauth2/v1/access_token',
body: {
code,
grant_type: 'authorization_code',
client_id: 'CIDPL49TEFPSPLZS',
client_secret: 'PQKQ0FKPLVFYIYIG3LZEVWB0B9WTZXNQ',
redirect_uri: 'http://localhost:8080/authorize'
},
json: true
})
console.log(result)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment