class Doorkeeper::TokensController

def create

def create
  response.headers.merge!({
    'Pragma'        => 'no-cache',
    'Cache-Control' => 'no-store',
  })
  if token.authorize
    render :json => token.authorization
  else
    render :json => token.error_response, :status => :unauthorized
  end
end

def token

def token
  @token ||= Doorkeeper::OAuth::AccessTokenRequest.new(params)
end