🐛 -1 fix

This commit is contained in:
EntireTwix 2021-04-22 01:13:35 -07:00
parent 9ec6a5de56
commit a898d6bb02

View file

@ -160,7 +160,7 @@ public:
Json::Value GetLogs(const std::string &name, const std::string &attempt) Json::Value GetLogs(const std::string &name, const std::string &attempt)
{ {
Json::Value res; Json::Value res;
users.if_contains(name, [&res, &attempt](const User &u) { if (!users.if_contains(name, [&res, &attempt](const User &u) {
if (u.password != XXH3_64bits(attempt.data(), attempt.size())) if (u.password != XXH3_64bits(attempt.data(), attempt.size()))
{ {
res = 0; res = 0;
@ -183,8 +183,10 @@ public:
res[j]["time"] = (Json::UInt64)u.log.data[i].time; res[j]["time"] = (Json::UInt64)u.log.data[i].time;
} }
} }
res = -1; }))
}); {
return -1;
}
return res; return res;
} }