0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-16 15:00:51 +01:00

modules/client/register: Add conf item to enable/disable registration.

This commit is contained in:
Jason Volk 2018-05-20 18:12:49 -07:00
parent f4acce9c91
commit 3774b61cb8

View file

@ -16,6 +16,13 @@ IRCD_MODULE
"Client 3.4.1 :Register"
};
ircd::conf::item<bool>
register_enable
{
{ "name", "ircd.client.register.enable" },
{ "default", true }
};
static void validate_user_id(const m::id::user &user_id);
static void validate_password(const string_view &password);
@ -24,6 +31,13 @@ post__register_user(client &client,
const resource::request::object<m::registar> &request)
try
{
if(!bool(register_enable))
throw m::error
{
http::UNAUTHORIZED, "M_REGISTRATION_DISABLED",
"Registration for this server is disabled."
};
// 3.3.1 Additional authentication information for the user-interactive authentication API.
const json::object &auth
{