refactor: check if federation is disabled inside the authcheck where possible

This commit is contained in:
Matthias Ahouansou 2024-03-16 19:04:54 +00:00
parent ab98b52b21
commit 5f0bea6961
No known key found for this signature in database
2 changed files with 4 additions and 68 deletions

View file

@ -149,6 +149,10 @@ where
}
}
AuthScheme::ServerSignatures => {
if !services().globals.allow_federation() {
return Err(Error::bad_config("Federation is disabled."));
}
let TypedHeader(Authorization(x_matrix)) = parts
.extract::<TypedHeader<Authorization<XMatrix>>>()
.await