Рабочая сборка с третьей ручкой

This commit is contained in:
Антон
2025-09-27 19:22:09 +03:00
parent 04fb9b7ff4
commit 2a99fc727c
3 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -37,7 +37,7 @@ public:
using namespace boost::beast;
using namespace std::string_literals;
auto body = req.body();
const auto body = req.body();
value req_json;
value response_body;
@@ -62,7 +62,7 @@ public:
return res;
}
std::optional<user> maybe_user = user_dao_->GetByLogin(login);
const std::optional<user> maybe_user = user_dao_->GetByLogin(login);
if (!maybe_user.has_value() || maybe_user.value().hashed_password != HashPassword(password))
{
@@ -75,7 +75,7 @@ public:
return res;
}
auto token = GenerateUUID();
const std::string token = GenerateUUID();
auth_dao_->Login(maybe_user.value().uuid, token);
http::response<ResponseType> res{http::status::ok, req.version()};
+1 -1
View File
@@ -35,7 +35,7 @@ public:
using namespace boost::beast;
using namespace std::string_literals;
auto body = req.body();
const auto body = req.body();
value req_json;
value response_body;
@@ -33,7 +33,7 @@ public:
using namespace boost::beast;
using namespace std::string_literals;
auto body = req.body();
const auto& body = req.body();
value req_json;
value response_body;
@@ -55,8 +55,8 @@ public:
return res;
}
std::string login = req_json.as_object().at("login").as_string().c_str();
std::string password = req_json.as_object().at("password").as_string().c_str();
const std::string login = req_json.as_object().at("login").as_string().c_str();
const std::string password = req_json.as_object().at("password").as_string().c_str();
if (!ValidateLogin(login) || !ValidatePassword(password))
{
@@ -95,7 +95,7 @@ public:
user.login = login;
user.hashed_password = HashPassword(password);
const auto uuid_stringified = user_dao_->Create(user);
const std::string uuid_stringified = user_dao_->Create(user);
http::response<ResponseType> res{
http::status::created, req.version()