summaryrefslogtreecommitdiff
path: root/lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex')
-rw-r--r--lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex b/lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex
index 317fd5445..a16f61435 100644
--- a/lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex
+++ b/lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex
@@ -3,6 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug do
+ import Pleroma.Web.TranslationHelpers
import Plug.Conn
alias Pleroma.Config
alias Pleroma.User
@@ -23,8 +24,7 @@ defmodule Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug do
{false, _} ->
conn
- |> put_resp_content_type("application/json")
- |> send_resp(403, Jason.encode!(%{error: "This resource requires authentication."}))
+ |> render_error(:forbidden, "This resource requires authentication.")
|> halt
end
end