Last active
May 28, 2019 05:54
-
-
Save KimGenius/16f15a89712af4c3f81c07ebb387c8ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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