Merge branch 'develop' into issue/1383
[akkoma] / lib / pleroma / web / mastodon_api / controllers / search_controller.ex
index 9f39b00f83af3684b822d8137169e992876d4025..0a929f55b9137aa87ff57fdbfab750a68cec7c59 100644 (file)
@@ -20,7 +20,9 @@ defmodule Pleroma.Web.MastodonAPI.SearchController do
   # Note: Mastodon doesn't allow unauthenticated access (requires read:accounts / read:search)
   plug(OAuthScopesPlug, %{scopes: ["read:search"], fallback: :proceed_unauthenticated})
 
-  plug(RateLimiter, :search when action in [:search, :search2, :account_search])
+  plug(Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug)
+
+  plug(RateLimiter, [name: :search] when action in [:search, :search2, :account_search])
 
   def account_search(%{assigns: %{user: user}} = conn, %{"q" => query} = params) do
     accounts = User.search(query, search_options(params, user))