diff --git a/auth.cpp b/auth.cpp index 6902225..abedaef 100644 --- a/auth.cpp +++ b/auth.cpp @@ -65,7 +65,6 @@ std::string get_str_between_two_str(const std::string& s, const std::string& sta int VerifyPayload(std::string signature, std::string timestamp, std::string body); void checkInit(); std::string checksum(); -void debugInfo(std::string data, std::string url, std::string response, std::string headers); void modify(); void runChecks(); void checkAtoms(); @@ -78,6 +77,7 @@ std::string signature; std::string signatureTimestamp; bool initialized; std::string API_PUBLIC_KEY = "5586b4bc69c7a4b487e4563a4cd96afd39140f919bd31cea7d1c6a1e8439422b"; +bool KeyAuth::api::debug = false; void KeyAuth::api::init() { @@ -1659,6 +1659,10 @@ std::string get_str_between_two_str(const std::string& s, last_delim_pos - end_pos_of_first_delim); } +void KeyAuth::api::setDebug(bool value) { + KeyAuth::api::debug = value; +} + std::string KeyAuth::api::req(std::string data, std::string url) { CURL* curl = curl_easy_init(); if (!curl) diff --git a/auth.hpp b/auth.hpp index f2f209f..3394e3c 100644 --- a/auth.hpp +++ b/auth.hpp @@ -18,8 +18,8 @@ namespace KeyAuth { std::string name, ownerid, version, url, path; static bool debug; - api(std::string name, std::string ownerid, std::string version, std::string url, std::string path, bool debug = false) { - debug = debug; + api(std::string name, std::string ownerid, std::string version, std::string url, std::string path, bool debugParameter = true) { + setDebug(debugParameter); } void ban(std::string reason = ""); @@ -108,6 +108,8 @@ namespace KeyAuth { static std::string req(std::string data, std::string url); static void debugInfo(std::string data, std::string url, std::string response, std::string headers); + + static void setDebug(bool value); void load_user_data(nlohmann::json data) { @@ -137,7 +139,7 @@ namespace KeyAuth { api::app_data.version = data[XorStr("version")]; api::app_data.customerPanelLink = data[XorStr("customerPanelLink")]; } - + void load_response_data(nlohmann::json data) { api::response.success = data[XorStr("success")]; api::response.message = data["message"];