Not sure if this works for you, but I had the same problem with Rails 5.0.0.beta3. I have not changed to the following line:
App.cable = Cable.createConsumer("ws://localhost:3000")
I saved it as it was before
@App ||= {} App.cable = ActionCable.createConsumer()
But what I changed is related to Cookies. No matter what . The cookie for my user_id will not be displayed. So I did the job. I got a cookie to save the username instead, then I was finally able to see it in a call to the find_verified_user function.
After the user logs in (# create sessions), I call a helper function:
sessions_helper.rb def set_cookie(user) the_username = user.username.to_s cookies.permanent.signed[:username] = the_username end
New find_verified_user
def find_verified_user if current_user = User.find_by_username(cookies.signed[:username]) current_user else reject_unauthorized_connection end end
This may or may not be the best solution, but after several hours of embarrassment and disappointment, it worked for my situation. Hope this helps someone.
source share