summaryrefslogtreecommitdiff
path: root/app/controllers/projects/git_http_client_controller.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-10-02 23:28:22 -0700
committerStan Hu <stanhu@gmail.com>2017-10-04 11:47:36 -0700
commit5d52bb59dc632601f4028b430deae7348c5e279b (patch)
treec183ffd1755c4c9e4b784d07e4437664cf4b8129 /app/controllers/projects/git_http_client_controller.rb
parentaaa57c9d35b1eb744fca970263220850db06639f (diff)
downloadgitlab-ce-5d52bb59dc632601f4028b430deae7348c5e279b.tar.gz
Fix username and ID not logging in production_json.log for Git activitysh-fix-username-logging
Devise sets `current_user`, but not all controllers authenticate users by session tokens. Try to use the controller-defined `authenticated_user` if `current_user` is not available. Closes gitlab-org/gitlab-ee#3611
Diffstat (limited to 'app/controllers/projects/git_http_client_controller.rb')
-rw-r--r--app/controllers/projects/git_http_client_controller.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/controllers/projects/git_http_client_controller.rb b/app/controllers/projects/git_http_client_controller.rb
index 7d0e2b3e2ef..95d7a02e9e9 100644
--- a/app/controllers/projects/git_http_client_controller.rb
+++ b/app/controllers/projects/git_http_client_controller.rb
@@ -9,6 +9,7 @@ class Projects::GitHttpClientController < Projects::ApplicationController
delegate :actor, :authentication_abilities, to: :authentication_result, allow_nil: true
alias_method :user, :actor
+ alias_method :authenticated_user, :actor
# Git clients will not know what authenticity token to send along
skip_before_action :verify_authenticity_token