Skip to content

Commit 8799bb0

Browse files
Merge pull request #44 from Shxde1/main2
Fixed issues
2 parents 7061c43 + 6e6523c commit 8799bb0

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

auth.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ std::string get_str_between_two_str(const std::string& s, const std::string& sta
6565
int VerifyPayload(std::string signature, std::string timestamp, std::string body);
6666
void checkInit();
6767
std::string checksum();
68-
void debugInfo(std::string data, std::string url, std::string response, std::string headers);
6968
void modify();
7069
void runChecks();
7170
void checkAtoms();
@@ -78,6 +77,7 @@ std::string signature;
7877
std::string signatureTimestamp;
7978
bool initialized;
8079
std::string API_PUBLIC_KEY = "5586b4bc69c7a4b487e4563a4cd96afd39140f919bd31cea7d1c6a1e8439422b";
80+
bool KeyAuth::api::debug = false;
8181

8282
void KeyAuth::api::init()
8383
{
@@ -1659,6 +1659,10 @@ std::string get_str_between_two_str(const std::string& s,
16591659
last_delim_pos - end_pos_of_first_delim);
16601660
}
16611661

1662+
void KeyAuth::api::setDebug(bool value) {
1663+
KeyAuth::api::debug = value;
1664+
}
1665+
16621666
std::string KeyAuth::api::req(std::string data, std::string url) {
16631667
CURL* curl = curl_easy_init();
16641668
if (!curl)

auth.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ namespace KeyAuth {
1818
std::string name, ownerid, version, url, path;
1919
static bool debug;
2020

21-
api(std::string name, std::string ownerid, std::string version, std::string url, std::string path, bool debug = false) {
22-
debug = debug;
21+
api(std::string name, std::string ownerid, std::string version, std::string url, std::string path, bool debugParameter = true) {
22+
setDebug(debugParameter);
2323
}
2424

2525
void ban(std::string reason = "");
@@ -108,6 +108,8 @@ namespace KeyAuth {
108108
static std::string req(std::string data, std::string url);
109109

110110
static void debugInfo(std::string data, std::string url, std::string response, std::string headers);
111+
112+
static void setDebug(bool value);
111113

112114

113115
void load_user_data(nlohmann::json data) {
@@ -137,7 +139,7 @@ namespace KeyAuth {
137139
api::app_data.version = data[XorStr("version")];
138140
api::app_data.customerPanelLink = data[XorStr("customerPanelLink")];
139141
}
140-
142+
141143
void load_response_data(nlohmann::json data) {
142144
api::response.success = data[XorStr("success")];
143145
api::response.message = data["message"];

0 commit comments

Comments
 (0)