fix: Forbid registering users with a non-local localpart

This commit is contained in:
Ginger
2026-02-20 20:39:38 -05:00
parent 0d1de70d8f
commit d9537e9b55
2 changed files with 13 additions and 0 deletions
+7
View File
@@ -252,6 +252,13 @@ pub(crate) async fn register_route(
}
}
// Don't allow registration with user IDs that aren't local
if !services.globals.user_is_local(&user_id) {
return Err!(Request(InvalidUsername(
"Username {body_username} is not local to this server"
)));
}
user_id
},
| Err(e) => {