summaryrefslogtreecommitdiff
path: root/app/controllers/oauth/applications_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-12-25 18:35:04 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-12-25 18:35:04 +0200
commit592e396869ba5dc116cec333733cea8dfbf4a9b5 (patch)
treed673da869a071d7e886491a51ce53c9829207e82 /app/controllers/oauth/applications_controller.rb
parent7fe8d41d88f744b16e6e12c1c07ef3f956994110 (diff)
downloadgitlab-ce-592e396869ba5dc116cec333733cea8dfbf4a9b5.tar.gz
Rework oauth2 feature
* improve UI * add authorization * add separate page for oauth applications Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/oauth/applications_controller.rb')
-rw-r--r--app/controllers/oauth/applications_controller.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rb
index b53e9662af0..93201eff303 100644
--- a/app/controllers/oauth/applications_controller.rb
+++ b/app/controllers/oauth/applications_controller.rb
@@ -3,7 +3,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
layout "profile"
def index
- @applications = current_user.oauth_applications
+ head :forbidden and return
end
def create
@@ -28,4 +28,14 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
redirect_to profile_account_url
end
+
+ private
+
+ def set_application
+ @application = current_user.oauth_applications.find(params[:id])
+ end
+
+ rescue_from ActiveRecord::RecordNotFound do |exception|
+ render "errors/not_found", layout: "errors", status: 404
+ end
end