diff options
author | Alex Gleason <alex@alexgleason.me> | 2021-05-24 11:24:24 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2021-05-24 11:42:49 -0500 |
commit | c9c6bd3e3627b1c592d9d5639cc8756c0862b77f (patch) | |
tree | 39bcc743c5da132f6ae1d9fae25c916f9ad0338b | |
parent | 4d4daee2327f288a748944a49f4238e3f2ef7ea6 (diff) | |
download | pleroma-c9c6bd3e3627b1c592d9d5639cc8756c0862b77f.tar.gz |
Cycles: elixir 1.9 fix
-rw-r--r-- | lib/pleroma/web/plugs/ensure_public_or_authenticated_plug.ex | 5 |
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, _} -> |