diff --git a/modules/client/register.cc b/modules/client/register.cc index 059537765..3e597d8be 100644 --- a/modules/client/register.cc +++ b/modules/client/register.cc @@ -67,13 +67,6 @@ resource::response post__register(client &client, const resource::request::object &request) { - if(!bool(register_enable)) - throw m::error - { - http::UNAUTHORIZED, "M_REGISTRATION_DISABLED", - "Registration for this server is disabled." - }; - const json::object &auth { json::get<"auth"_>(request) @@ -85,6 +78,13 @@ post__register(client &client, client, http::UNAUTHORIZED, json::object{flows} }; + if(!bool(register_enable)) + throw m::error + { + http::FORBIDDEN, "M_REGISTRATION_DISABLED", + "Registration for this server is disabled." + }; + const auto kind { request.query["kind"] @@ -117,7 +117,7 @@ try if(!bool(register_user_enable)) throw m::error { - http::UNAUTHORIZED, "M_REGISTRATION_DISABLED", + http::FORBIDDEN, "M_REGISTRATION_DISABLED", "User registration for this server is disabled." };