summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-05-24 11:24:24 -0500
committerAlex Gleason <alex@alexgleason.me>2021-05-24 11:42:49 -0500
commitc9c6bd3e3627b1c592d9d5639cc8756c0862b77f (patch)
tree39bcc743c5da132f6ae1d9fae25c916f9ad0338b
parent4d4daee2327f288a748944a49f4238e3f2ef7ea6 (diff)
Cycles: elixir 1.9 fix
-rw-r--r--lib/pleroma/web/plugs/ensure_public_or_authenticated_plug.ex5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/web/plugs/ensure_public_or_authenticated_plug.ex b/lib/pleroma/web/plugs/ensure_public_or_authenticated_plug.ex
index ffc546e1b..90d04ec7c 100644
--- a/lib/pleroma/web/plugs/ensure_public_or_authenticated_plug.ex
+++ b/lib/pleroma/web/plugs/ensure_public_or_authenticated_plug.ex
@@ -15,6 +15,8 @@ defmodule Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug do
use Pleroma.Web, :plug
+ @user Module.concat(["Pleroma.User"])
+
def init(options) do
options
end
@@ -27,7 +29,8 @@ defmodule Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug do
{true, _} ->
conn
- {false, %{assigns: %{user: user}}} when is_struct(user) ->
+ # This weird match of %User{} prevents compile-time cycles
+ {false, %{assigns: %{user: %{__struct__: @user}}}} ->
conn
{false, _} ->