diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-03 15:22:15 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-03 15:22:15 +0300 |
commit | d3a6712e419bc6fc2c11a584d17ec83c2c2d3522 (patch) | |
tree | b584406549fe84443a5913f0d756d7fc6d454078 /app/controllers | |
parent | c3d02481519a29927e63d55b417b3e5ef71f1bd1 (diff) | |
parent | 932e80ed0ec0002e76a1eca03ac7d5a642b8d580 (diff) |
Merge branch 'fix/gb/improve-blocked-user-tracking' into 'master'
Improve blocked user tracking and fire some events only once
Closes #49784
See merge request gitlab-org/gitlab-ce!20959
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application_controller.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 73d7b8cb9cf..783831748a7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -108,6 +108,7 @@ class ApplicationController < ActionController::Base def append_info_to_payload(payload) super + payload[:remote_ip] = request.remote_ip logged_user = auth_user @@ -122,12 +123,16 @@ class ApplicationController < ActionController::Base end end + ## # Controllers such as GitHttpController may use alternative methods - # (e.g. tokens) to authenticate the user, whereas Devise sets current_user + # (e.g. tokens) to authenticate the user, whereas Devise sets current_user. + # def auth_user - return current_user if current_user.present? - - return try(:authenticated_user) + if user_signed_in? + current_user + else + try(:authenticated_user) + end end # This filter handles personal access tokens, and atom requests with rss tokens |