added better database lookup api

This commit is contained in:
2025-10-19 15:29:04 +02:00
parent ac6e47d906
commit 4916b4f1c1
2 changed files with 32 additions and 11 deletions

View File

@@ -94,9 +94,9 @@ bool loginUser(const std::string& username, const std::string& password)
if (!db.open())
return false;
auto opt_str = db.get<std::string>(sql, {username});
if (opt_str.has_value()) {
return verifyHashWithPassword(opt_str.value(), password);
auto opt_pair = db.get<int, std::string>(sql, {username});
if (opt_pair.has_value()) {
return verifyHashWithPassword(opt_pair.value().second, password);
} else {
return false;
}