mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 16:28:28 +00:00
Fix bug with command length
This commit is contained in:
@@ -161,32 +161,32 @@ namespace LoginserverWebserver {
|
||||
|
||||
api.Post(
|
||||
"/account/credentials/validate/external", [](const httplib::Request &request, httplib::Response &res) {
|
||||
LoginserverWebserver::TokenManager::AuthCanRead(request, res);
|
||||
Json::Value request_body = LoginserverWebserver::ParseRequestBody(request);
|
||||
std::string username = request_body.get("username", "").asString();
|
||||
std::string password = request_body.get("password", "").asString();
|
||||
LoginserverWebserver::TokenManager::AuthCanRead(request, res);
|
||||
Json::Value request_body = LoginserverWebserver::ParseRequestBody(request);
|
||||
std::string username = request_body.get("username", "").asString();
|
||||
std::string password = request_body.get("password", "").asString();
|
||||
|
||||
Json::Value response;
|
||||
if (username.empty() || password.empty()) {
|
||||
response["error"] = "Username or password not set";
|
||||
LoginserverWebserver::SendResponse(response, res);
|
||||
return;
|
||||
}
|
||||
|
||||
bool credentials_valid = AccountManagement::CheckExternalLoginserverUserCredentials(
|
||||
username,
|
||||
password
|
||||
);
|
||||
|
||||
if (credentials_valid) {
|
||||
response["message"] = "Credentials valid!";
|
||||
}
|
||||
else {
|
||||
response["error"] = "Credentials invalid!";
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
if (username.empty() || password.empty()) {
|
||||
response["error"] = "Username or password not set";
|
||||
LoginserverWebserver::SendResponse(response, res);
|
||||
return;
|
||||
}
|
||||
|
||||
bool credentials_valid = AccountManagement::CheckExternalLoginserverUserCredentials(
|
||||
username,
|
||||
password
|
||||
);
|
||||
|
||||
if (credentials_valid) {
|
||||
response["message"] = "Credentials valid!";
|
||||
}
|
||||
else {
|
||||
response["error"] = "Credentials invalid!";
|
||||
}
|
||||
|
||||
LoginserverWebserver::SendResponse(response, res);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user