Подготовка интеграционного теста

This commit is contained in:
Антон
2025-10-17 08:51:16 +03:00
parent 38a8d5effd
commit d0ad4ae189
3 changed files with 18 additions and 4 deletions
+4 -1
View File
@@ -50,7 +50,8 @@ public:
}
catch (const system::system_error& err)
{
throw session_exception(http::status::bad_request, "cannot deserialize json");
BOOST_LOG_TRIVIAL(info) << "POST /api/v1/Auth/Login - Response 500: Cannot deserialize json";
throw session_exception(http::status::internal_server_error, "Cannot deserialize json");
}
@@ -59,6 +60,7 @@ public:
if (login.empty() || password.empty())
{
BOOST_LOG_TRIVIAL(info) << "POST /api/v1/Auth/Login - Response 422: Login or password are empty";
throw session_exception(http::status::unprocessable_entity, "Login or password are empty"s);
}
@@ -66,6 +68,7 @@ public:
if (!maybe_user.has_value() && maybe_user.value().hashed_password != HashPassword(password))
{
BOOST_LOG_TRIVIAL(info) << "POST /api/v1/Auth/Login - Response 403: Incorrect login or password";
throw session_exception(http::status::forbidden,"Incorrect login or password");
}
const std::string token = GenerateUUID();