13 lines
403 B
JavaScript
13 lines
403 B
JavaScript
const axios = require('axios')
|
|
|
|
module.exports = async function (access_token) {
|
|
return await axios.get('https://id.twitch.tv/oauth2/validate', {
|
|
headers: {
|
|
'Authorization': `OAuth ${access_token}`,
|
|
}
|
|
}).then(response => {
|
|
//console.log(response.data)
|
|
if (response.data.status === '401') return false
|
|
else return true
|
|
}).catch(error => { console.log(error.response.data) })
|
|
} |