the response should never be empty but we need to check the json lib for exceptions and return appropriately... + cleanup a bit - closes #33

This commit is contained in:
DarthArgus
2016-05-22 17:44:00 +00:00
parent a78fbb9978
commit a05e61e0fe
4 changed files with 22 additions and 24 deletions
@@ -192,23 +192,16 @@ void ClientConnection::validateClient(const std::string & id, const std::string
std::string response = webAPI::simplePost(authURL, std::string(postBuf.str()), "");
if (!response.empty())
if (response == "success")
{
if (response == "success")
{
authOK = 1;
}
else
{
ErrorMessage err("Login Failed", response);
this->send(err, true);
}
authOK = 1;
}
else
{
ErrorMessage err("Login Failed", "Error connecting to authentication provider.");
ErrorMessage err("Login Failed", response);
this->send(err, true);
}
}
else
{