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,
|
user: User,
|
||||||
info: Json<DataCreateServer>,
|
info: Json<DataCreateServer>,
|
||||||
) -> Result<Json<CreateServerResponse>> {
|
) -> Result<Json<CreateServerResponse>> {
|
||||||
|
if user.bot.is_some() {
|
||||||
|
return Err(Error::IsBot);
|
||||||
|
}
|
||||||
|
|
||||||
let info = info.into_inner();
|
let info = info.into_inner();
|
||||||
info.validate()
|
info.validate()
|
||||||
.map_err(|error| Error::FailedValidation { error })?;
|
.map_err(|error| Error::FailedValidation { error })?;
|
||||||
|
|||||||
Reference in New Issue
Block a user