Bind oauth applications to users
This commit is contained in:
18
app/controllers/oauth/applications_controller.rb
Normal file
18
app/controllers/oauth/applications_controller.rb
Normal file
@ -0,0 +1,18 @@
|
||||
class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
|
||||
before_filter :authenticate_user!
|
||||
|
||||
def index
|
||||
@applications = current_user.oauth_applications
|
||||
end
|
||||
|
||||
def create
|
||||
@application = Doorkeeper::Application.new(application_params)
|
||||
@application.owner = current_user
|
||||
|
||||
if @application.save
|
||||
redirect_to oauth_application_url(@application)
|
||||
else
|
||||
render :new
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user