forked from jmug/stoatchat
fix: deny access for bot creating a server (#238)
This commit is contained in:
@@ -44,6 +44,10 @@ pub async fn req(
|
||||
user: User,
|
||||
info: Json<DataCreateServer>,
|
||||
) -> Result<Json<CreateServerResponse>> {
|
||||
if user.bot.is_some() {
|
||||
return Err(Error::IsBot);
|
||||
}
|
||||
|
||||
let info = info.into_inner();
|
||||
info.validate()
|
||||
.map_err(|error| Error::FailedValidation { error })?;
|
||||
|
||||
Reference in New Issue
Block a user