1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-11-16 12:40:50 +01:00

fix(admin): don't allow creation of remote users

This commit is contained in:
Matthias Ahouansou 2024-05-02 10:45:04 +01:00
parent 0074aca0ef
commit 9db1f5a13c
No known key found for this signature in database
2 changed files with 8 additions and 1 deletions

1
Cargo.lock generated
View file

@ -432,7 +432,6 @@ dependencies = [
"tracing-flame",
"tracing-opentelemetry",
"tracing-subscriber",
"trust-dns-resolver",
"url",
]

View file

@ -605,6 +605,14 @@ impl Service {
)))
}
};
// Checks if user is local
if user_id.server_name() != services().globals.server_name() {
return Ok(RoomMessageEventContent::text_plain(
"The specified user is not from this server!",
));
};
if user_id.is_historical() {
return Ok(RoomMessageEventContent::text_plain(format!(
"Userid {user_id} is not allowed due to historical"