Skip to content

Commit

Permalink
Revert "Change search API to be accessible without being logged in (m…
Browse files Browse the repository at this point in the history
…astodon#18963)"

This reverts commit c579077.
  • Loading branch information
ClearlyClaire authored and aescling committed Nov 17, 2022
1 parent 04be581 commit 6148f69
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/api/v2/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ class Api::V2::SearchController < Api::BaseController

RESULTS_LIMIT = (ENV['MAX_SEARCH_RESULTS'] || 20).to_i

before_action -> { authorize_if_got_token! :read, :'read:search' }
before_action -> { doorkeeper_authorize! :read, :'read:search' }
before_action :require_user!

def index
@search = Search.new(search_results)
Expand All @@ -29,7 +30,7 @@ def search_results
params[:q],
current_account,
limit_param(RESULTS_LIMIT),
search_params.merge(resolve: user_signed_in? ? truthy_param?(:resolve) : false, exclude_unreviewed: truthy_param?(:exclude_unreviewed))
search_params.merge(resolve: truthy_param?(:resolve), exclude_unreviewed: truthy_param?(:exclude_unreviewed))
)
end

Expand Down

0 comments on commit 6148f69

Please sign in to comment.