module-and-template-store/app/controllers/oauth/applications_controller.rb

20 lines
619 B
Ruby

class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
before_filter :authenticate_user!
def index
@applications = current_user.oauth_applications
end
# only needed if each application must have some owner
def create
@application = Doorkeeper::Application.new(application_params)
@application.owner = current_user if Doorkeeper.configuration.confirm_application_owner?
if @application.save
flash[:notice] = I18n.t(:notice, :scope => [:doorkeeper, :flash, :applications, :create])
respond_with [:oauth, @application]
else
render :new
end
end
end