module Doorkeeper::Rails::Helpers

def doorkeeper_error

def doorkeeper_error
  if doorkeeper_invalid_token_response?
    OAuth::InvalidTokenResponse.from_access_token(doorkeeper_token)
  else
    OAuth::ForbiddenTokenResponse.from_scopes(@_doorkeeper_scopes)
  end
end