generated from Sithas/conan_template
Подготовка интеграционного теста
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user