| 710 | } |
| 711 | |
| 712 | static void revokeToken(const std::string &token) |
| 713 | { |
| 714 | httplib::Client cli("https://id.twitch.tv"); |
| 715 | auto response = cli.Post("/oauth2/revoke", |
| 716 | std::string("client_id=") + GetClientID() + |
| 717 | "&token=" + token, |
| 718 | "application/x-www-form-urlencoded"); |
| 719 | if (!response) { |
| 720 | auto err = response.error(); |
| 721 | blog(LOG_INFO, "Failed to revoke token: %s", |
| 722 | httplib::to_string(err).c_str()); |
| 723 | return; |
| 724 | } |
| 725 | if (response->status != 200) { |
| 726 | blog(LOG_INFO, "Failed to revoke token: %d", response->status); |
| 727 | } |
| 728 | } |
| 729 | |
| 730 | static std::string generateStateString() |
| 731 | { |
nothing calls this directly
no test coverage detected