summaryrefslogtreecommitdiff
path: root/app/controllers/confirmations_controller.rb
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2017-10-23 19:04:57 +0300
committerBrett Walker <bwalker@gitlab.com>2017-10-23 19:04:57 +0300
commit57a275791ff0e263dbe07ba7f1bfc4fdf53842cf (patch)
tree2d767aaf9766f145322db9177c7f1cac36e81621 /app/controllers/confirmations_controller.rb
parentd5e2f873db06f6505ceac0936bdf50f5e312f70b (diff)
downloadgitlab-ce-57a275791ff0e263dbe07ba7f1bfc4fdf53842cf.tar.gz
grab the correct username when confirming secondary email
Diffstat (limited to 'app/controllers/confirmations_controller.rb')
-rw-r--r--app/controllers/confirmations_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb
index 80ab681ed87..43b5d557429 100644
--- a/app/controllers/confirmations_controller.rb
+++ b/app/controllers/confirmations_controller.rb
@@ -15,7 +15,8 @@ class ConfirmationsController < Devise::ConfirmationsController
if signed_in?(:user)
after_sign_in(resource)
else
- Gitlab::AppLogger.info("Email Confirmed: username=#{resource.username} email=#{resource.email} ip=#{request.remote_ip}")
+ username = (_resource_name == :email ? resource.user.username : resource.username)
+ Gitlab::AppLogger.info("Email Confirmed: username=#{username} email=#{resource.email} ip=#{request.remote_ip}")
flash[:notice] += " Please sign in."
new_session_path(:user)
end