mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 08:12:37 +01:00
modules/client/register: Fix flows regression; minor cleanup.
This commit is contained in:
parent
b42ded1fc7
commit
0f6363f3e5
1 changed files with 33 additions and 2 deletions
|
@ -16,8 +16,14 @@ IRCD_MODULE
|
|||
"Client 3.4.1 :Register"
|
||||
};
|
||||
|
||||
static void validate_password(const string_view &password);
|
||||
extern "C" void validate_user_id(const m::id::user &user_id);
|
||||
extern const std::string
|
||||
flows;
|
||||
|
||||
static void
|
||||
validate_password(const string_view &password);
|
||||
|
||||
extern "C" void
|
||||
validate_user_id(const m::id::user &user_id);
|
||||
|
||||
extern "C" std::string
|
||||
register_user(const m::registar &,
|
||||
|
@ -68,6 +74,17 @@ post__register(client &client,
|
|||
"Registration for this server is disabled."
|
||||
};
|
||||
|
||||
const json::object &auth
|
||||
{
|
||||
json::get<"auth"_>(request)
|
||||
};
|
||||
|
||||
if(empty(auth))
|
||||
return resource::response
|
||||
{
|
||||
client, http::UNAUTHORIZED, json::object{flows}
|
||||
};
|
||||
|
||||
const auto kind
|
||||
{
|
||||
request.query["kind"]
|
||||
|
@ -328,3 +345,17 @@ validate_password(const string_view &password)
|
|||
"The desired password is too long"
|
||||
};
|
||||
}
|
||||
|
||||
const std::string
|
||||
flows
|
||||
{R"({
|
||||
"flows":
|
||||
[
|
||||
{
|
||||
"stages":
|
||||
[
|
||||
"m.login.dummy", "m.login.password"
|
||||
]
|
||||
}
|
||||
]
|
||||
})"};
|
||||
|
|
Loading…
Reference in a new issue