Refactoring of :if_func / :unless_func plug options (general availability). Added tests for Pleroma.Web.Plug.

This commit is contained in:
Ivan Tashkinov 2020-04-30 18:19:51 +03:00
commit 2c4844237f
9 changed files with 109 additions and 24 deletions

View file

@ -27,7 +27,7 @@ defmodule Pleroma.Web.Feed.UserController do
when format in ["json", "activity+json"] do
with %{halted: false} = conn <-
Pleroma.Plugs.EnsureAuthenticatedPlug.call(conn,
unless_func: &Pleroma.Web.FederatingPlug.federating?/0
unless_func: &Pleroma.Web.FederatingPlug.federating?/1
) do
ActivityPubController.call(conn, :user)
end