Refactoring of :if_func / :unless_func plug options
Refactoring of :if_func
/ :unless_func
plug options:
-
Now available to all plugs having
use Pleroma.Web, :plug
— keepingPleroma.Plugs.EnsureAuthenticatedPlug
-specific doesn't make sense (also, previouslyEnsureAuthenticatedPlug
was added to called plugs list before the above options were processed, so the plug might be actually bypassed because of these options but still be present in called plugs list; this MR fixes that). -
Changed arity from 0 to 1 (
Plug.Conn
record is being passed as an argument).
Added tests for Pleroma.Web.Plug.