mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 23:10:54 +01:00
modules/client/register: Add conf item to enable/disable registration.
This commit is contained in:
parent
f4acce9c91
commit
3774b61cb8
1 changed files with 14 additions and 0 deletions
|
@ -16,6 +16,13 @@ IRCD_MODULE
|
||||||
"Client 3.4.1 :Register"
|
"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_user_id(const m::id::user &user_id);
|
||||||
static void validate_password(const string_view &password);
|
static void validate_password(const string_view &password);
|
||||||
|
|
||||||
|
@ -24,6 +31,13 @@ post__register_user(client &client,
|
||||||
const resource::request::object<m::registar> &request)
|
const resource::request::object<m::registar> &request)
|
||||||
try
|
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.
|
// 3.3.1 Additional authentication information for the user-interactive authentication API.
|
||||||
const json::object &auth
|
const json::object &auth
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue