summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-06-08 13:57:58 +0000
committerRémy Coutable <remy@rymai.me>2016-06-08 13:57:58 +0000
commit99ea32714bb307421ff81ad17983c1b0dce0eac4 (patch)
tree7d22ac6ec07413b5bfb505097cdeb9d56bd013b6 /app
parent8d6c4b307c2c0ecffc57aaf4ebd0e5a23eae0a66 (diff)
parent3b50d96b8aaa7e18efded9a80c7641d1364de5c9 (diff)
downloadgitlab-ce-99ea32714bb307421ff81ad17983c1b0dce0eac4.tar.gz
Merge branch 'fix-endless-redirect' into 'master'
Fix endless redirections when accessing user OAuth applications when they are disabled ## What does this MR do? This MR fixes a bug where the browser would be redirect endlessly when attempting to access the user's OAuth applications when an admin has disabled this system-wide setting. ## Are there points in the code the reviewer needs to double check? I assume disabling the nav button is better than showing a page that says, "OAuth applications are disabled by the admin." ## Why was this MR needed? Lots of users were confused when they hit endless redirect errors. ## What are the relevant issue numbers? #14770 See merge request !4525
Diffstat (limited to 'app')
-rw-r--r--app/controllers/oauth/applications_controller.rb2
-rw-r--r--app/views/layouts/nav/_profile.html.haml11
2 files changed, 7 insertions, 6 deletions
diff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rb
index c6bdd0602c1..0f54dfa4efc 100644
--- a/app/controllers/oauth/applications_controller.rb
+++ b/app/controllers/oauth/applications_controller.rb
@@ -32,7 +32,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
def verify_user_oauth_applications_enabled
return if current_application_settings.user_oauth_applications?
- redirect_to applications_profile_url
+ redirect_to profile_path
end
def set_index_vars
diff --git a/app/views/layouts/nav/_profile.html.haml b/app/views/layouts/nav/_profile.html.haml
index 2efc6c48a48..09d9f0184be 100644
--- a/app/views/layouts/nav/_profile.html.haml
+++ b/app/views/layouts/nav/_profile.html.haml
@@ -10,11 +10,12 @@
= icon('gear fw')
%span
Account
- = nav_link(controller: 'oauth/applications') do
- = link_to applications_profile_path, title: 'Applications' do
- = icon('cloud fw')
- %span
- Applications
+ - if current_application_settings.user_oauth_applications?
+ = nav_link(controller: 'oauth/applications') do
+ = link_to applications_profile_path, title: 'Applications' do
+ = icon('cloud fw')
+ %span
+ Applications
= nav_link(controller: :emails) do
= link_to profile_emails_path, title: 'Emails' do
= icon('envelope-o fw')