Prevent access to bot routes as bot.
This commit is contained in:
@@ -5,6 +5,10 @@ use serde_json::Value;
|
||||
|
||||
#[get("/<target>")]
|
||||
pub async fn fetch_bot(user: User, target: Ref) -> Result<Value> {
|
||||
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