From c9c6bd3e3627b1c592d9d5639cc8756c0862b77f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 24 May 2021 11:24:24 -0500 Subject: Cycles: elixir 1.9 fix --- lib/pleroma/web/plugs/ensure_public_or_authenticated_plug.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, _} -> -- cgit v1.2.3