From: lain Date: Wed, 6 May 2020 09:14:05 +0000 (+0000) Subject: Merge branch 'plug-if-unless-func-options-refactoring' into 'develop' X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=07e7c80bc9e919cd92ca9dda1e21384142e5bd77;p=akkoma Merge branch 'plug-if-unless-func-options-refactoring' into 'develop' Refactoring of :if_func / :unless_func plug options See merge request pleroma/pleroma!2446 --- 07e7c80bc9e919cd92ca9dda1e21384142e5bd77 diff --cc lib/pleroma/web/activity_pub/activity_pub_controller.ex index f607931ab,a909516be..ab9d1e0b7 --- a/lib/pleroma/web/activity_pub/activity_pub_controller.ex +++ b/lib/pleroma/web/activity_pub/activity_pub_controller.ex @@@ -34,13 -34,12 +34,13 @@@ defmodule Pleroma.Web.ActivityPub.Activ plug( EnsureAuthenticatedPlug, - [unless_func: &FederatingPlug.federating?/0] when action not in @federating_only_actions + [unless_func: &FederatingPlug.federating?/1] when action not in @federating_only_actions ) + # Note: :following and :followers must be served even without authentication (as via :api) plug( EnsureAuthenticatedPlug - when action in [:read_inbox, :update_outbox, :whoami, :upload_media, :following, :followers] + when action in [:read_inbox, :update_outbox, :whoami, :upload_media] ) plug(