AddUser is togglable now

This commit is contained in:
EntireTwix 2021-12-02 12:09:52 -08:00
parent 5026285d1b
commit 32e91a188a

View file

@ -205,7 +205,7 @@ void api::AdminVerifyAccount(req_args)
}
void api::ApiProperties(req_args)
{
std::string info = "{\"version\":" + std::to_string(API_VERSION) + ",\"max_log\":" + std::to_string(MAX_LOG_SIZE);
std::string info = "{\"version\":" + std::to_string(API_VERSION) + ",\"max_log\":" + std::to_string(MAX_LOG_SIZE) + ",\"add_user_open\":" + std::to_string(ADD_USER_OPEN);
if constexpr (RETURN_ON_DEL)
{
info += ",\"return_on_del\":\"" + std::string(return_account) + "\"}";
@ -257,6 +257,9 @@ void api::PruneUsers(req_args)
void api::AddUser(req_args)
{
if constexpr (ADD_USER_OPEN)
{
SIMD_JSON_GEN;
BankResponse res;
if (doc.error())
@ -279,6 +282,14 @@ void api::AddUser(req_args)
}
}
RESPONSE_PARSE(std::move(res));
}
else
{
auto resp = HttpResponse::newCustomHttpResponse(BankResponse{k404NotFound, "\"AddUser is Disabled\""});
CORS;
CACHE_FOREVER;
callback(resp);
}
}
void api::AdminAddUser(req_args)
{