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
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-14 19:39:15 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-14 19:39:15 +0400
commit2d65430cd7b2cf3795f922f70ec1b63f12affed6 (patch)
tree71a3ab2a3229a81f5894eaf92286eeab96748f55 /lib/api/helpers.rb
parent36dc6e6b510625708836d0d1d6faf17527446e15 (diff)
parent671cdc5c5fbb67cfe30cdf580c07ec5b5d46253f (diff)
Merge branch 'api_token_cast_5_4' of /home/git/repositories/gitlab/gitlabhq into 5-4-stablev5.4.2
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index f857d4133b2..c99264da550 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -1,7 +1,8 @@
module API
module APIHelpers
def current_user
- @current_user ||= User.find_by_authentication_token(params[:private_token] || env["HTTP_PRIVATE_TOKEN"])
+ private_token = (params[:private_token] || env["HTTP_PRIVATE_TOKEN"]).to_s
+ @current_user ||= User.find_by_authentication_token(private_token)
end
def user_project