- changed login request from GET to POST - implement json body conversion to DTO objects - set `user_id` and `role` attributes for HttpRequest inside filter
25 lines
511 B
C++
25 lines
511 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <spdlog/logger.h>
|
|
|
|
class IUserStorage;
|
|
class UserManager;
|
|
class LoginRequestDto;
|
|
class RegisterRequestDto;
|
|
|
|
class AuthService
|
|
{
|
|
public:
|
|
AuthService();
|
|
|
|
bool authenticateUser(LoginRequestDto& loginData, std::string& outToken);
|
|
bool registerUser(RegisterRequestDto& registerData, std::string& outToken);
|
|
|
|
private:
|
|
std::shared_ptr<spdlog::logger> m_logger;
|
|
std::shared_ptr<IUserStorage> m_userStorage;
|
|
std::shared_ptr<UserManager> m_userManager;
|
|
};
|