fix: reject /register requests when there is no token and the type is appservice
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
7a1a271518
commit
c61aee4f1c
2 changed files with 7 additions and 6 deletions
|
@ -145,11 +145,7 @@ pub async fn login_route(body: Ruma<login::v3::Request>) -> Result<login::v3::Re
|
|||
}) => {
|
||||
debug!("Got appservice login type");
|
||||
if !body.from_appservice {
|
||||
info!(
|
||||
"User tried logging in as an appservice, but request body is not from a known/registered \
|
||||
appservice"
|
||||
);
|
||||
return Err(Error::BadRequest(ErrorKind::Forbidden, "Forbidden login type."));
|
||||
return Err(Error::BadRequest(ErrorKind::MissingToken, "Missing Appservice token."));
|
||||
};
|
||||
let username = if let Some(UserIdentifier::UserIdOrLocalpart(user_id)) = identifier {
|
||||
user_id.to_lowercase()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue