Panel terminé + Refresh token auto

This commit is contained in:
Zachary Guénot
2023-05-11 00:37:16 +02:00
parent de01c981f8
commit 8846299424
18 changed files with 251 additions and 64 deletions

13
utils/validateToken.js Normal file
View File

@@ -0,0 +1,13 @@
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) })
}