1
0
mirror of https://github.com/mastodon/mastodon synced 2024-12-24 11:38:18 +09:00
mastodon/app/controllers/api/v1/accounts/lookup_controller.rb
2021-02-16 15:28:32 +01:00

17 lines
438 B
Ruby

# frozen_string_literal: true
class Api::V1::Accounts::LookupController < Api::BaseController
before_action -> { authorize_if_got_token! :read, :'read:accounts' }
before_action :set_account
def show
render json: @account, serializer: REST::AccountSerializer
end
private
def set_account
@account = ResolveAccountService.new.call(params[:acct], skip_webfinger: true) || raise(ActiveRecord::RecordNotFound)
end
end