From a159d01e994654aaa482a8c5f8defa73ef69d51c Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 29 Dec 2024 03:47:55 +0100 Subject: [PATCH] fix: oops must also set actor id --- upub/routes/src/activitypub/application.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/upub/routes/src/activitypub/application.rs b/upub/routes/src/activitypub/application.rs index 5bf7174..aded7a0 100644 --- a/upub/routes/src/activitypub/application.rs +++ b/upub/routes/src/activitypub/application.rs @@ -95,12 +95,12 @@ pub async fn ap_fetch( ) -> crate::ApiResult> { let _user; // need this for lifetimes - let pkey = match auth { + let (from, key) = match auth { crate::Identity::Anonymous => { if !ctx.cfg().security.allow_public_debugger { return Err(crate::ApiError::unauthorized()); } - ctx.pkey() + (ctx.base(), ctx.pkey()) }, crate::Identity::Remote { .. } => return Err(crate::ApiError::forbidden()), crate::Identity::Local { internal, .. } => { @@ -108,10 +108,10 @@ pub async fn ap_fetch( .one(ctx.db()) .await?; match _user { - None => ctx.pkey(), + None => (ctx.base(), ctx.pkey()), Some(ref u) => match u.private_key { - None => ctx.pkey(), - Some(ref k) => k.as_str(), + None => (ctx.base(), ctx.pkey()), + Some(ref k) => (u.id.as_str(), k.as_str()), } } }, @@ -121,8 +121,8 @@ pub async fn ap_fetch( Method::GET, &query.uri, None, - ctx.base(), - pkey, + from, + key, &format!("{}+fetch", ctx.domain()), ) .await?