【发布时间】:2020-10-12 20:12:44
【问题描述】:
几个月前我写了一个 Discord OAuth2 验证代码,它成功了。但现在它不起作用。 Discord 响应“请求中缺少“代码””。我看了看,我的请求发送了代码。我该如何解决这个问题?
取码access_token:
const response = await fetch(`https://discordapp.com/api/oauth2/token?grant_type=authorization_code&code=${code}&redirect_uri=${loginredirect}`,
{
method: 'POST',
headers: {
Authorization: `Basic ${creds}`,
}
});
const json = await response.json();
【问题讨论】: