summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api')
-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