微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Twitch API-注销

如何解决Twitch API-注销

我正在用react和twitch API创建一个小型应用程序。 我的问题是我希望能够从该帐户注销,以便可以返回登录页面并使用其他帐户重新进行身份验证。即使查看文档并提出撤销令牌的(发布)请求也不会注销...

文档链接https://dev.twitch.tv/docs/authentication?fbclid=IwAR0wioF_kRKLPCKm_bEtJ2v6o-Pi2Z7sIr8-B2gvrLWIcW6qqqm87eTEytg#revoking-access-tokens

我忘记了什么吗?

const token = `${localStorage.getItem("token")}`;

const parameters = {
  client_id: client_id,token: token,};

const queryString = Object.keys(parameters)
  .map((key) => key + "=" + parameters[key])
  .join("&");

const url_redirect = `https://id.twitch.tv/oauth2/revoke?${queryString}`;

const logout = () => {
  axios.post(url_redirect).then((response) => {
    console.log(response);
    return response;
  });
};

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。