фича: автообновление сессии

This commit is contained in:
2025-01-17 19:09:44 +03:00
parent a4214fd007
commit 3537965393
16 changed files with 170 additions and 96 deletions

View File

@@ -70,20 +70,23 @@ namespace http::auth {
* @note Класс устанавливает заголовок 'Set-Cookie' в ответе, и этот заголовок должен дойти до пользователя!
*/
class AuthProvider {
void updateSessionHook();
public:
AuthProvider();
/**
* Авторизовать пользователя.
*
* @param req
* @param rep
* @return true, в случае успешной авторизации
*/
std::shared_ptr<http::auth::User> doAuth(const std::string &username, const std::string &password, server::Reply &rep);
std::shared_ptr<http::auth::User> doAuth(const std::string &username, const std::string &password, const server::Request &req, server::Reply &rep);
std::vector<std::shared_ptr<User>> users;
std::shared_ptr<User> getSession(const server::Request &req);
std::shared_ptr<User> getSession(const server::Request &req, server::Reply &rep);
~AuthProvider();
};