summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2019-10-07 11:06:30 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2019-10-07 11:06:30 +0300
commit28fb98d69e31ce5a09e15e213491b880430a0902 (patch)
tree2910113e8a4ed4d225a4ffc8b6b95d56e782367f /lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
parentf459aabdfafa990b33610438650f882ccac072d2 (diff)
parentb4f3c16885a489c40de82e5ef321caafa4b10c81 (diff)
downloadpleroma-28fb98d69e31ce5a09e15e213491b880430a0902.tar.gz
pleroma-28fb98d69e31ce5a09e15e213491b880430a0902.zip
Merge remote-tracking branch 'remotes/upstream/develop' into 1260-rate-limited-auth-actions
# Conflicts: # CHANGELOG.md
Diffstat (limited to 'lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex')
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex b/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
index 9076bb849..fe71c36af 100644
--- a/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
@@ -8,11 +8,16 @@ defmodule Pleroma.Web.MastodonAPI.SuggestionController do
require Logger
alias Pleroma.Config
+ alias Pleroma.Plugs.OAuthScopesPlug
alias Pleroma.User
alias Pleroma.Web.MediaProxy
action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
+ plug(OAuthScopesPlug, %{scopes: ["read"]} when action == :index)
+
+ plug(Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug)
+
@doc "GET /api/v1/suggestions"
def index(%{assigns: %{user: user}} = conn, _) do
if Config.get([:suggestions, :enabled], false) do