To only have ActionCable's JS connect for logged in users, we can setup our Javascript to know when a user is authenticated or not, and have our websocket try to connect accordingly.