forked from chookspace/chookchat
start work on persistent login
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user