add command to set the allow registration status

Co-Authored-By: Matthias Ahouansou <matthias@ahouansou.cz>
This commit is contained in:
tony 2023-06-04 00:12:35 +02:00 committed by Matthias Ahouansou
parent 817f382c5f
commit 6bcc2f80b8
No known key found for this signature in database
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.",