v.1.4.3/api update
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
const VoxeetSecret = require('../VoxeetSecret.json');
|
||||
const fetch = require('node-fetch');
|
||||
module.exports = async (req, res) => {
|
||||
const { key, secret } = VoxeetSecret;
|
||||
const credentials = Buffer.from(encodeURI(key) + ':' + encodeURI(secret)).toString('base64');
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Cache-Control': 'no-cache',
|
||||
Authorization: 'Basic ' + credentials,
|
||||
};
|
||||
const oauth = await fetch(VoxeetSecret.validateURL, {
|
||||
method: 'POST',
|
||||
headers,
|
||||
body: JSON.stringify({
|
||||
grant_type: 'client_credentials',
|
||||
}),
|
||||
})
|
||||
.then((oauthResponse) => oauthResponse.json())
|
||||
.catch((err) => res.status(500).send(err));
|
||||
if (oauth) res.status(200).send(oauth);
|
||||
};
|
||||
Reference in New Issue
Block a user