Modif utils pour "require-all" + Fix refresh error
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const axios = require('axios')
|
||||
|
||||
module.exports = async function (client_id, client_secret, refresh_token) {
|
||||
module.exports = refreshToken = (async (client_id, client_secret, refresh_token) => {
|
||||
return await axios.post('https://id.twitch.tv/oauth2/token', {
|
||||
client_id,
|
||||
client_secret,
|
||||
@@ -10,4 +10,4 @@ module.exports = async function (client_id, client_secret, refresh_token) {
|
||||
//console.log(response.data)
|
||||
if (response.data.token_type === 'bearer') return [response.data.access_token, response.data.refresh_token]
|
||||
}).catch(error => { return error.response.data })
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user