Commit 1a115cecb453f3dca65d9f69c87dca28595cd75a
1 parent
36dc6e6b
Make sure private_token for API is a string
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
lib/api/helpers.rb
1 | 1 | module API |
2 | 2 | module APIHelpers |
3 | 3 | def current_user |
4 | - @current_user ||= User.find_by_authentication_token(params[:private_token] || env["HTTP_PRIVATE_TOKEN"]) | |
4 | + private_token = (params[:private_token] || env["HTTP_PRIVATE_TOKEN"]).to_s | |
5 | + @current_user ||= User.find_by_authentication_token(private_token) | |
5 | 6 | end |
6 | 7 | |
7 | 8 | def user_project | ... | ... |