0
0
Fork 0
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:
Jason Volk 2019-01-12 12:33:00 -08:00
parent b42ded1fc7
commit 0f6363f3e5

View file

@ -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"
]
}
]
})"};