diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-04-06 10:20:44 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-04-06 10:20:44 +0300 |
commit | fc81e5a49c34224e07e85f490a30f92db0835d45 (patch) | |
tree | 347f7eee028404e7e1422ca94ce837bda756e3b3 /lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex | |
parent | 8444e7ee9651f3b1836954a3891b5ae26ee79f99 (diff) | |
download | pleroma-fc81e5a49c34224e07e85f490a30f92db0835d45.tar.gz pleroma-fc81e5a49c34224e07e85f490a30f92db0835d45.zip |
Enforcement of OAuth scopes check for authenticated API endpoints, :skip_plug plug to mark a plug explicitly skipped (disabled).
Diffstat (limited to 'lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex')
-rw-r--r-- | lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex b/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex index 0cdc7bd8d..c93a43969 100644 --- a/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex @@ -5,10 +5,13 @@ defmodule Pleroma.Web.MastodonAPI.SuggestionController do use Pleroma.Web, :controller + alias Pleroma.Plugs.OAuthScopesPlug + require Logger + plug(OAuthScopesPlug, %{scopes: ["read"]} when action == :index) + @doc "GET /api/v1/suggestions" - def index(conn, _) do - json(conn, []) - end + def index(conn, params), + do: Pleroma.Web.MastodonAPI.MastodonAPIController.empty_array(conn, params) end |