forked from jmug/stoatchat
Prevent access to bot routes as bot.
This commit is contained in:
@@ -23,6 +23,10 @@ pub enum Destination {
|
||||
|
||||
#[post("/<target>/invite", data = "<dest>")]
|
||||
pub async fn invite_bot(user: User, target: Ref, dest: Json<Destination>) -> Result<EmptyResponse> {
|
||||
if user.bot.is_some() {
|
||||
return Err(Error::IsBot)
|
||||
}
|
||||
|
||||
let bot = target.fetch_bot().await?;
|
||||
|
||||
if !bot.public {
|
||||
|
||||
Reference in New Issue
Block a user