v1.6.0/admin only mode
This commit is contained in:
@@ -1,21 +1,20 @@
|
||||
const VoxeetSecret = require('../VoxeetSecret.json');
|
||||
module.exports = async (req, res) => {
|
||||
res.status(403).send({ message: 'Voice calls are unavailable temporarily.' });
|
||||
// const { key, secret } = VoxeetSecret;
|
||||
// const credentials = btoa(encodeURI(key) + ':' + encodeURI(secret));
|
||||
// const headers = {
|
||||
// 'Content-Type': 'application/json',
|
||||
// 'Cache-Control': 'no-cache',
|
||||
// Authorization: 'Basic ' + credentials,
|
||||
// };
|
||||
// const oauth = await fetch(VoxeetSecret.refreshURL, {
|
||||
// method: 'POST',
|
||||
// headers,
|
||||
// body: JSON.stringify({
|
||||
// refresh_token: req.params.token,
|
||||
// }),
|
||||
// })
|
||||
// .then((oauthResponse) => oauthResponse.json())
|
||||
// .catch((err) => res.status(500).send(err));
|
||||
// if (oauth) res.status(200).send(oauth);
|
||||
const { key, secret } = VoxeetSecret;
|
||||
const credentials = btoa(encodeURI(key) + ':' + encodeURI(secret));
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Cache-Control': 'no-cache',
|
||||
Authorization: 'Basic ' + credentials,
|
||||
};
|
||||
const oauth = await fetch(VoxeetSecret.refreshURL, {
|
||||
method: 'POST',
|
||||
headers,
|
||||
body: JSON.stringify({
|
||||
refresh_token: req.params.token,
|
||||
}),
|
||||
})
|
||||
.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