Older/WebApplication/Session.h
luocai 27ffee57be
Some checks failed
Deploy / PullDocker (push) Successful in 4s
Deploy / Build (push) Failing after 1m34s
Deploy Docker Images / Docusaurus build and Server deploy (push) Successful in 14s
add blog code.
2024-11-01 19:05:20 +08:00

26 lines
667 B
C++

#ifndef __SESSION_H__
#define __SESSION_H__
#include "model/User.h"
#include <Wt/Auth/Login.h>
#include <Wt/Dbo/Session.h>
using AuthInfo = Wt::Auth::Dbo::AuthInfo<User>;
using UserDatabase = Wt::Auth::Dbo::UserDatabase<AuthInfo>;
class Session : public Wt::Dbo::Session {
public:
Session(const std::string &sqliteDb);
~Session();
Wt::Auth::AbstractUserDatabase &users();
Wt::Auth::Login &login();
static void configureAuth();
static const Wt::Auth::AuthService &auth();
static const Wt::Auth::PasswordService &passwordAuth();
private:
std::unique_ptr<UserDatabase> m_users;
Wt::Auth::Login m_login;
};
#endif // __SESSION_H__