|
37 | 37 | #include <stdexcept> |
38 | 38 | #include <string> |
39 | 39 | #include <array> |
40 | | -#include <chrono> |
41 | 40 |
|
42 | 41 | #include <functional> |
43 | 42 | #include <vector> |
@@ -485,7 +484,7 @@ void KeyAuth::api::web_login() |
485 | 484 | NULL, |
486 | 485 | NULL |
487 | 486 | ); |
488 | | - |
| 487 | + |
489 | 488 | if (result == NO_ERROR) { |
490 | 489 | going = false; |
491 | 490 | } |
@@ -1061,17 +1060,18 @@ std::string KeyAuth::api::fetchonline() |
1061 | 1060 | return onlineusers; |
1062 | 1061 | } |
1063 | 1062 |
|
1064 | | -void KeyAuth::api::forgot(std::string username, std::string email) |
| 1063 | +void KeyAuth::api::forgot(std::string username, std::string email) |
1065 | 1064 | { |
1066 | 1065 | auto data = |
1067 | 1066 | XorStr("type=forgot") + |
1068 | 1067 | XorStr("&username=") + username + |
1069 | 1068 | XorStr("&email=") + email + |
1070 | | - XorStr("&sessionid=") +sessionid + |
| 1069 | + XorStr("&sessionid=") + sessionid + |
1071 | 1070 | XorStr("&name=") + name + |
1072 | 1071 | XorStr("&ownerid=") + ownerid; |
1073 | 1072 | auto response = req(data, url); |
1074 | 1073 | auto json = response_decoder.parse(response); |
| 1074 | + load_response_data(json); |
1075 | 1075 | } |
1076 | 1076 |
|
1077 | 1077 | // credits https://stackoverflow.com/a/3790661 |
@@ -1101,7 +1101,6 @@ std::string get_str_between_two_str(const std::string& s, |
1101 | 1101 | } |
1102 | 1102 |
|
1103 | 1103 | std::string KeyAuth::api::req(std::string data, std::string url) { |
1104 | | - auto timestart = std::chrono::high_resolution_clock::now(); |
1105 | 1104 | CURL* curl = curl_easy_init(); |
1106 | 1105 | if (!curl) |
1107 | 1106 | return XorStr("null"); |
@@ -1130,8 +1129,6 @@ std::string KeyAuth::api::req(std::string data, std::string url) { |
1130 | 1129 | if (code != CURLE_OK) |
1131 | 1130 | error(curl_easy_strerror(code)); |
1132 | 1131 |
|
1133 | | - auto timeend = std::chrono::high_resolution_clock::now(); |
1134 | | - KeyAuth::api::data.responsetime = std::chrono::duration_cast<std::chrono::milliseconds>(timestart - timeend).count(); |
1135 | 1132 | return to_return; |
1136 | 1133 | } |
1137 | 1134 | void error(std::string message) { |
@@ -1314,4 +1311,3 @@ void modify() |
1314 | 1311 | Sleep(50); |
1315 | 1312 | } |
1316 | 1313 | } |
1317 | | - |
0 commit comments