metamaps--metamaps/app/controllers/api/v2/tokens_controller.rb
Devin Howard 7eae8deacb revamp HTML template a bit for api docs (#757)
* my_tokens endpoint moved to normal index

* remove secured_by from metacodes/users

* ch ch ch changes

* mess with template

* fix securedBy

* convenience open

* gross authentication notes at the top of every endpoint

* better ordering

* move login tutorials into security tab

* oauth tutorial

* getting closer

* remove unneeded Endpoints header

* ok looks OK
2016-10-12 13:54:43 -04:00

23 lines
484 B
Ruby

# frozen_string_literal: true
module Api
module V2
class TokensController < RestfulController
def searchable_columns
[:description]
end
def create
if params[:token].blank?
self.resource = resource_class.new
else
instantiate_resource
end
resource.user = current_user if current_user.present?
authorize resource
create_action
respond_with_resource
end
end
end
end