]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #3462 - Require authentication for search API (#4155)
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 11 Jul 2017 15:08:26 +0000 (17:08 +0200)
committerGitHub <noreply@github.com>
Tue, 11 Jul 2017 15:08:26 +0000 (17:08 +0200)
This makes it consistent with /api/v1/accounts/search and
previous behaviour has been an oversight.

app/controllers/api/v1/search_controller.rb

index 1353682eaf68fb3204f05d38ee4066926f4d1fe7..bc5b8e5d4075f79618341b2d1b5e20520fd71d6d 100644 (file)
@@ -3,6 +3,9 @@
 class Api::V1::SearchController < Api::BaseController
   RESULTS_LIMIT = 5
 
+  before_action -> { doorkeeper_authorize! :read }
+  before_action :require_user!
+
   respond_to :json
 
   def index