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
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-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