This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
|
||||
namespace lm {
|
||||
|
||||
class Database;
|
||||
|
||||
struct AuthSession
|
||||
{
|
||||
std::string token;
|
||||
@@ -24,7 +26,7 @@ struct AuthSession
|
||||
class AuthService
|
||||
{
|
||||
public:
|
||||
explicit AuthService(std::filesystem::path store_path);
|
||||
explicit AuthService(Database& db);
|
||||
|
||||
httplib::Server::HandlerResponse preRoute(const httplib::Request& req, httplib::Response& res);
|
||||
|
||||
@@ -55,7 +57,7 @@ public:
|
||||
void registerRoutes(httplib::Server& svr);
|
||||
|
||||
private:
|
||||
std::filesystem::path store_path_;
|
||||
Database& db_;
|
||||
mutable std::mutex mu_;
|
||||
nlohmann::json data_;
|
||||
std::unordered_map<std::string, AuthSession> sessions_;
|
||||
|
||||
Reference in New Issue
Block a user