fix setting gon.api_token

This commit is contained in:
Dmitriy Zaporozhets 2013-03-13 23:45:47 +02:00
parent bdcaf21ea7
commit 10f14136f5

View file

@ -152,7 +152,9 @@ class ApplicationController < ActionController::Base
def add_gon_variables def add_gon_variables
gon.default_issues_tracker = Project.issues_tracker.default_value gon.default_issues_tracker = Project.issues_tracker.default_value
if current_user
gon.api_token = current_user.private_token gon.api_token = current_user.private_token
gon.gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url gon.gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
end end
end
end end