forked from mtusi2026/mtusi2026lab2
lab2
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "db.hpp"
|
||||
#include "session_repo_base.hpp"
|
||||
|
||||
class PgSessionRepo : public ISessionRepo {
|
||||
public:
|
||||
PgSessionRepo(PgPool& pool, int ttl_seconds)
|
||||
: pool_(pool), ttl_(ttl_seconds) {}
|
||||
|
||||
Created create(const std::string& user_id) override;
|
||||
std::optional<std::string> lookup(const std::string& token) override;
|
||||
bool revoke(const std::string& token) override;
|
||||
|
||||
private:
|
||||
PgPool& pool_;
|
||||
int ttl_;
|
||||
};
|
||||
Reference in New Issue
Block a user