Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-08-03 15:22:15 +0300
committerSean McGivern <sean@mcgivern.me.uk>2018-08-03 15:22:15 +0300
commitd3a6712e419bc6fc2c11a584d17ec83c2c2d3522 (patch)
treeb584406549fe84443a5913f0d756d7fc6d454078 /app/controllers
parentc3d02481519a29927e63d55b417b3e5ef71f1bd1 (diff)
parent932e80ed0ec0002e76a1eca03ac7d5a642b8d580 (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.rb13
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