MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / revokeToken

Function revokeToken

plugins/twitch/token.cpp:712–728  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

710}
711
712static 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
730static std::string generateStateString()
731{

Callers

nothing calls this directly

Calls 4

GetClientIDFunction · 0.85
to_stringFunction · 0.85
PostMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected