prepare for release

This commit is contained in:
2026-02-14 11:30:48 +01:00
parent 8fd76c7e46
commit 61d011063b
16 changed files with 58 additions and 368 deletions

View File

@@ -59,22 +59,17 @@ int createUser(const std::string& username, const std::string& password){
if (username.empty() || password.empty())
return -1;
int64_t id;
int64_t id = -1;
auto db = dbpool.acquire();
for (auto &u : db->get_all<login::User>()) {
if (u.username == username){
std::cout << "WTF" << std::endl;
id = u.id;
break;
};
}
auto user = db->get_optional<login::User>(
where(c(&login::User::username) == username)
);
if (user.has_value()) {
id = user.value().id;
} else {
if (id < 0){
User usr = newUser(username);
createPasswordHash(usr, password);
id = db->insert(usr);