summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-02-29 14:47:21 +0000
committerPhil Hughes <me@iamphill.com>2016-03-04 09:06:07 +0000
commit33ba32e6cc12eb8a8bddd957bb99bd2df7628a70 (patch)
tree7ded2909e24141dd2cf7666b7964fb73a188d5ad /app/controllers
parentf8c4dc97230c520df077c1274fd8d88680da5242 (diff)
downloadgitlab-ce-33ba32e6cc12eb8a8bddd957bb99bd2df7628a70.tar.gz
Applications tab on profile settings
Closes #13855
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/oauth/applications_controller.rb6
-rw-r--r--app/controllers/profiles_controller.rb1
2 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rb
index dc22101cd5e..d983ae0b8c6 100644
--- a/app/controllers/oauth/applications_controller.rb
+++ b/app/controllers/oauth/applications_controller.rb
@@ -11,6 +11,10 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
head :forbidden and return
end
+ def new
+ redirect_to applications_profile_url
+ end
+
def create
@application = Doorkeeper::Application.new(application_params)
@@ -20,7 +24,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create])
redirect_to oauth_application_url(@application)
else
- render :new
+ redirect_to applications_profile_url, flash: {application: @application}
end
end
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index fa7a1148961..75eb9bdb96f 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -13,6 +13,7 @@ class ProfilesController < Profiles::ApplicationController
@authorized_tokens = current_user.oauth_authorized_tokens
@authorized_anonymous_tokens = @authorized_tokens.reject(&:application)
@authorized_apps = @authorized_tokens.map(&:application).uniq - [nil]
+ @application = flash[:application] || Doorkeeper::Application.new
end
def update