diff --git a/src/DAO/IAuthDAO.h b/src/DAO/IAuthDAO.h index eccea50..45746cd 100644 --- a/src/DAO/IAuthDAO.h +++ b/src/DAO/IAuthDAO.h @@ -12,7 +12,7 @@ class IAuthDAO public: virtual std::string Login(const std::string& registrated_user_uuid) = 0; - virtual bool HasAuthorizedUser(const std::string& auth_token) = 0; + virtual bool HasAuthorized(const std::string& auth_token) = 0; virtual bool Logout(const std::string& user_token) = 0; diff --git a/src/DAO/MemoryAuthDAO.cpp b/src/DAO/MemoryAuthDAO.cpp index 5d4715f..434fadb 100644 --- a/src/DAO/MemoryAuthDAO.cpp +++ b/src/DAO/MemoryAuthDAO.cpp @@ -22,9 +22,9 @@ std::string MemoryAuthDAO::Login(const std::string& registrated_user_uuid) return auth_token; } -bool MemoryAuthDAO::HasAuthorizedUser(const std::string& user_uuid) +bool MemoryAuthDAO::HasAuthorized(const std::string& auth_token) { - return users_uuids_to_auth_tokens_.count(user_uuid) > 0; + return auth_tokens_to_users_uuids_.count(auth_token) > 0; } bool MemoryAuthDAO::Logout(const std::string& auth_token) diff --git a/src/DAO/MemoryAuthDAO.h b/src/DAO/MemoryAuthDAO.h index 919350d..c28cc0d 100644 --- a/src/DAO/MemoryAuthDAO.h +++ b/src/DAO/MemoryAuthDAO.h @@ -21,7 +21,7 @@ public: std::string Login(const std::string& registrated_user_uuid) override; - bool HasAuthorizedUser(const std::string& auth_token) override; + bool HasAuthorized(const std::string& auth_token) override; bool Logout(const std::string& auth_token) override; };