MCPcopy Create free account
hub / github.com/chrxh/alien / activateUser

Method activateUser

source/Network/NetworkService.cpp:128–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128bool 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
152bool NetworkService::login(LoginErrorCode& errorCode, std::string const& userName, std::string const& password, UserInfo const& userInfo)
153{

Callers 1

onActivateUserMethod · 0.80

Calls 6

logFunction · 0.85
configureClientFunction · 0.85
executeRequestFunction · 0.85
parseBoolResultFunction · 0.85
logNetworkErrorFunction · 0.85
PostMethod · 0.80

Tested by

no test coverage detected