Skip to content

Commit

Permalink
invoke User.find_by only if userid is instance of String
Browse files Browse the repository at this point in the history
  • Loading branch information
yrudman committed Sep 6, 2019
1 parent 4afdee6 commit ff1d50b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/channels/application_cable/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def connect
def find_verified_user
return reject_unauthorized_connection unless cookies[:ws_token]
userid = TokenManager.new('ws').token_get_info(cookies[:ws_token], :userid)
if current_user = User.find_by(:userid => userid)
if current_user = User.find_by(:userid => userid.presence)
current_user
else
reject_unauthorized_connection
Expand Down

0 comments on commit ff1d50b

Please sign in to comment.