Older/WebApplication/Session.h
luocai 1eaa4a6787
All checks were successful
Deploy / PullDocker (push) Successful in 8s
Deploy / Build (push) Successful in 2m46s
add code.
2024-10-31 19:40:29 +08:00

25 lines
613 B
C++

#ifndef __SESSION_H__
#define __SESSION_H__
#include "User.h"
#include <Wt/Auth/Login.h>
#include <Wt/Dbo/Session.h>
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__