const axios = require('axios') module.exports = async function (client_id, client_secret, refresh_token) { return await axios.post('https://id.twitch.tv/oauth2/token', { client_id, client_secret, refresh_token, grant_type: 'refresh_token' }).then(response => { //console.log(response.data) if (response.data.token_type === 'bearer') return [response.data.access_token, response.data.refresh_token] }).catch(error => { console.log(error.response.data) }) }