Merge branch 'toggle_allow_register' into 'next'

add command to set the allow registration status

See merge request famedly/conduit!477
This commit is contained in:
Matthias Ahouansou 2024-05-29 09:08:59 +00:00
commit c732c7c97f
3 changed files with 33 additions and 3 deletions

View file

@ -75,7 +75,7 @@ pub async fn get_register_available_route(
/// - Creates a new account and populates it with default account data
/// - If `inhibit_login` is false: Creates a device and returns device id and access_token
pub async fn register_route(body: Ruma<register::v3::Request>) -> Result<register::v3::Response> {
if !services().globals.allow_registration() && body.appservice_info.is_none() {
if !services().globals.allow_registration().await && body.appservice_info.is_none() {
return Err(Error::BadRequest(
ErrorKind::Forbidden,
"Registration has been disabled.",