forked from mtusi2026/mtusi2026lab5
18 lines
440 B
C++
18 lines
440 B
C++
#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_;
|
|
}; |