mirror of
https://github.com/matrix-construct/construct
synced 2024-10-05 23:28:53 +02:00
modules/client/register: Allow flows request before denying registration otherwise Riot infinite-loops.
This commit is contained in:
parent
47bcfaecb4
commit
3deeab99de
1 changed files with 8 additions and 8 deletions
|
@ -67,13 +67,6 @@ resource::response
|
|||
post__register(client &client,
|
||||
const resource::request::object<m::registar> &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."
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue