Skip to content

Commit

Permalink
Merge pull request #44 from Shxde1/main2
Browse files Browse the repository at this point in the history
Fixed issues
  • Loading branch information
Its-Networking authored Jan 29, 2025
2 parents 7061c43 + 6e6523c commit 8799bb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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()
{
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions auth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "");
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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"];
Expand Down

0 comments on commit 8799bb0

Please sign in to comment.