start work on persistent login

This commit is contained in:
2026-07-21 12:06:46 +10:00
parent cca6737791
commit 4ce1d56d69
8 changed files with 255 additions and 6 deletions

View File

@@ -11,6 +11,8 @@
void sanitize(std::string& str);
std::string generateSecureToken(size_t numBytes);
struct User {
uint64_t id = 0;
std::string name = "";
@@ -41,6 +43,8 @@ class Database {
std::optional<User> getUser(uint64_t id);
std::optional<User> getUserByName(const std::string& name);
std::optional<User> getUserByToken(const std::string& token);
std::optional<std::string> createNewToken(uint64_t id);
// this will modify the user to have their user ID
void addUser(User& user);