projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make activity announceable by its author.
[akkoma]
/
lib
/
pleroma
/
plugs
/
ensure_public_or_authenticated_plug.ex
diff --git
a/lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex
b/lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex
index 317fd5445008a89eda6778ccd08cdf936d1320fa..a16f6143560cab615ee016fab33a2e13f189db52 100644
(file)
--- 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
# 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
import Plug.Conn
alias Pleroma.Config
alias Pleroma.User
@@
-23,8
+24,7
@@
defmodule Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug do
{false, _} ->
conn
{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
|> halt
end
end