Commit 10f14136 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

fix setting gon.api_token

parent bdcaf21e
......@@ -152,7 +152,9 @@ class ApplicationController < ActionController::Base
def add_gon_variables
gon.default_issues_tracker = Project.issues_tracker.default_value
gon.api_token = current_user.private_token
gon.gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
if current_user
gon.api_token = current_user.private_token
gon.gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment