Class: Doorkeeper::TokenInfoController

Inherits:
ApplicationMetalController show all
Defined in:
app/controllers/doorkeeper/token_info_controller.rb

Constant Summary

Constants inherited from ApplicationMetalController

ApplicationMetalController::MODULES

Instance Method Summary collapse

Instance Method Details

#showObject


3
4
5
6
7
8
9
10
11
# File 'app/controllers/doorkeeper/token_info_controller.rb', line 3

def show
  if doorkeeper_token && doorkeeper_token.accessible?
    render json: doorkeeper_token, status: :ok
  else
    error = OAuth::ErrorResponse.new(name: :invalid_request)
    response.headers.merge!(error.headers)
    render json: error.body, status: error.status
  end
end