summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorOren Kanner <okanner@gmail.com>2016-11-17 23:21:02 -0500
committerOren Kanner <okanner@gmail.com>2016-11-17 23:28:39 -0500
commit8dd9a8b6e00cbd91f8455218397c8da716fc9b00 (patch)
tree38bc5d16f631b01d1ba181085953783541691dd9 /app/controllers/application_controller.rb
parent694b55c8281be12d5403dbb8bc6c8951f2716df5 (diff)
downloadgitlab-ce-8dd9a8b6e00cbd91f8455218397c8da716fc9b00.tar.gz
Allow admins to stop impersonating users without e-mail addresses
Resolves #24576 Modify the guard clause of the `ApplicationController#require_email` before action to skip requests where an admin is impersonating the current user.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 517ad4f03f3..2713c0f1dc8 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -224,7 +224,7 @@ class ApplicationController < ActionController::Base
end
def require_email
- if current_user && current_user.temp_oauth_email?
+ if current_user && current_user.temp_oauth_email? && session[:impersonator_id].nil?
redirect_to profile_path, notice: 'Please complete your profile with email address' and return
end
end