mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
![Claire](/assets/img/avatar_default.png)
Fixes #17898 Since #17204, the admin API has only been available through the web application because of the unconditional requirement to provide a valid CSRF token. This commit changes it back to `null_session`, which should make it work both with session-based authentication (provided a CSRF token) and with a bearer token.
18 lines
394 B
Ruby
18 lines
394 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Api::V1::Admin::Trends::TagsController < Api::BaseController
|
|
before_action -> { authorize_if_got_token! :'admin:read' }
|
|
before_action :require_staff!
|
|
before_action :set_tags
|
|
|
|
def index
|
|
render json: @tags, each_serializer: REST::Admin::TagSerializer
|
|
end
|
|
|
|
private
|
|
|
|
def set_tags
|
|
@tags = Trends.tags.query.limit(limit_param(10))
|
|
end
|
|
end
|