Refactor authentication: replace tuple with DTO, namespace config
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <stdexcept>
|
||||
#include "DataStore.h"
|
||||
#include "Enums.h"
|
||||
|
||||
using AuthenticationDTO = std::tuple<Enums::LoginStatus, Enums::EmployeeType, Enums::EmployeeDesignation>;
|
||||
|
||||
class AuthenticationManagementService
|
||||
{
|
||||
private:
|
||||
DataStore& m_dataStore;
|
||||
public:
|
||||
AuthenticationManagementService() : m_dataStore(DataStore::getInstance()) {};
|
||||
std::tuple<Enums::LoginStatus, Enums::EmployeeType, Enums::EmployeeDesignation> login(const std::string& username, const std::string& password);
|
||||
AuthenticationDTO login(const std::string& username, const std::string& password);
|
||||
void logout();
|
||||
void changePassword(const std::string&);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user