fix: can only update self

This commit is contained in:
əlemi 2024-06-10 06:44:26 +02:00
parent 2d08511e05
commit 105b829e32
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -259,6 +259,9 @@ pub async fn update(ctx: &crate::Context, activity: impl apb::Activity, tx: &Dat
match object_node.object_type()? { match object_node.object_type()? {
apb::ObjectType::Actor(_) => { apb::ObjectType::Actor(_) => {
if oid != actor_id {
return Err(ProcessorError::Unauthorized);
}
let internal_uid = crate::model::actor::Entity::ap_to_internal(&oid, tx) let internal_uid = crate::model::actor::Entity::ap_to_internal(&oid, tx)
.await? .await?
.ok_or(ProcessorError::Incomplete)?; .ok_or(ProcessorError::Incomplete)?;