| 126 | } |
| 127 | |
| 128 | bool NetworkService::activateUser(std::string const& userName, std::string const& password, UserInfo const& userInfo, std::string const& confirmationCode) |
| 129 | { |
| 130 | log(Priority::Important, "network: activate user '" + userName + "'"); |
| 131 | |
| 132 | httplib::SSLClient client(_serverAddress); |
| 133 | configureClient(client); |
| 134 | |
| 135 | httplib::Params params; |
| 136 | params.emplace("userName", userName); |
| 137 | params.emplace("password", password); |
| 138 | params.emplace("activationCode", confirmationCode); |
| 139 | if (userInfo.gpu) { |
| 140 | params.emplace("gpu", *userInfo.gpu); |
| 141 | } |
| 142 | |
| 143 | try { |
| 144 | auto result = executeRequest([&] { return client.Post("/alien-server/activateuser.php", params); }); |
| 145 | return parseBoolResult(result->body); |
| 146 | } catch (...) { |
| 147 | logNetworkError(); |
| 148 | return false; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | bool NetworkService::login(LoginErrorCode& errorCode, std::string const& userName, std::string const& password, UserInfo const& userInfo) |
| 153 | { |
no test coverage detected