アプリケーションで ActinCable を使用していますが、認証に問題があります。現在、actioncable は、サイトに住んでいるすべての人を繰り返し承認しようとしています。
これにより、ログに一定のストリームが返さAn unauthorized connection attempt was rejectedれます。これは、サインインしていない訪問者もアクセスを試みているためです。
私connection.rbはこのように見えます:
module ApplicationCable
  class Connection < ActionCable::Connection::Base
    identified_by :current_user
    def connect
      self.current_user = find_verified_user
    end
    protected
      def find_verified_user
        if current_user = User.find_by(id: cookies.signed[:user_id])
          current_user
        else
          reject_unauthorized_connection
        end
      end
  end
end
connnection.rb現在、サイトを使用するすべての訪問者ではなく、サインインしている人だけが承認されるようにできるかどうか疑問に思っています。私は ActionCable に慣れていないため、これを制限する方法を知ることができません。また、ActionCable のドキュメントはまだ初期段階にあります。