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

Method logout

source/Network/NetworkService.cpp:188–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188bool NetworkService::logout()
189{
190 log(Priority::Important, "network: logout");
191 bool result = true;
192
193 if (_loggedInUserName && _password) {
194 httplib::SSLClient client(_serverAddress);
195 configureClient(client);
196
197 httplib::Params params;
198 params.emplace("userName", *_loggedInUserName);
199 params.emplace("password", *_password);
200
201 try {
202 result = executeRequest([&] { return client.Post("/alien-server/logout.php", params); });
203 } catch (...) {
204 logNetworkError();
205 result = false;
206 }
207 }
208
209 _loggedInUserName = std::nullopt;
210 _password = std::nullopt;
211 return result;
212}
213
214void NetworkService::refreshLogin()
215{

Callers 2

processToolbarMethod · 0.80
processMenubarMethod · 0.80

Calls 5

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

Tested by

no test coverage detected