From 24fbdf2b0a820684b69b10893e82cdb1a76ca14d Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 13 Jun 2023 16:47:56 +0200 Subject: [chore] Refactor AP authentication, other small bits of tidying up (#1874) --- internal/federation/federatingdb/create.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'internal/federation/federatingdb/create.go') diff --git a/internal/federation/federatingdb/create.go b/internal/federation/federatingdb/create.go index f68279d37..3650f8c3d 100644 --- a/internal/federation/federatingdb/create.go +++ b/internal/federation/federatingdb/create.go @@ -57,12 +57,9 @@ func (f *federatingDB) Create(ctx context.Context, asType vocab.Type) error { l.Trace("entering Create") } - receivingAccount, requestingAccount := extractFromCtx(ctx) - if receivingAccount == nil { - // If the receiving account wasn't set on the context, that means this request didn't pass - // through the API, but came from inside GtS as the result of another activity on this instance. That being so, - // we can safely just ignore this activity, since we know we've already processed it elsewhere. - return nil + receivingAccount, requestingAccount, internal := extractFromCtx(ctx) + if internal { + return nil // Already processed. } switch asType.GetTypeName() { -- cgit v1.2.3