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:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-04 19:07:15 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-04 19:07:15 +0400
commitd95d56f0b9b2a321e18bb0f92b008f58e37b20a7 (patch)
tree8c915ac563dc49191a01c3cc092d69597a368244 /app
parentec8d39897c76439c71b79738c5a348b36a03753b (diff)
Add current_user_id to gon vars
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 2730e9942ec..aa532de7aa4 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -174,10 +174,14 @@ class ApplicationController < ActionController::Base
def add_gon_variables
gon.default_issues_tracker = Project.issues_tracker.default_value
gon.api_version = API::API.version
- gon.api_token = current_user.private_token if current_user
gon.gravatar_url = request.ssl? || Gitlab.config.gitlab.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
gon.relative_url_root = Gitlab.config.gitlab.relative_url_root
gon.gravatar_enabled = Gitlab.config.gravatar.enabled
+
+ if current_user
+ gon.current_user_id = current_user.id
+ gon.api_token = current_user.private_token
+ end
end
def check_password_expiration