#include "Session.h" #include "BoostLog.h" #include #include #include #include #include #include #include #include #include Session::Session(const std::string &sqliteDb) { auto connection = std::make_unique(sqliteDb); connection->setProperty("show-queries", "true"); setConnection(std::move(connection)); mapClass("user"); mapClass("auth_info"); mapClass("auth_identity"); mapClass("auth_token"); try { createTables(); LOG(info) << "Created database."; } catch (Wt::Dbo::Exception &e) { LOG(error) << e.what() << ", using existing database"; } m_users = std::make_unique(*this); } Session::~Session() { } Wt::Auth::AbstractUserDatabase &Session::users() { return *m_users; } Wt::Auth::Login &Session::login() { return m_login; }