【发布时间】:2021-04-11 18:12:13
【问题描述】:
const response = await fetch(`https://discordapp.com/api/oauth2/token`, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: JSON.stringify({
client_id: process.env.CLIENT_ID,
client_secret: process.env.CLIENT_SECRET,
redirect_uri: redirectURL,
grant_type: 'authorization_code',
code: code,
}),
});
当我运行上面的代码时,它返回{ error: 'invalid_grant' },我不知道为什么。有什么解决办法吗?谢谢。
【问题讨论】:
标签: javascript oauth-2.0 discord