Sha256: 33d8ee14d09968c8dce60a40715d343e796926c649e2d4266c877083b61f4ba8

Contents?: true

Size: 345 Bytes

Versions: 11

Compression:

Stored size: 345 Bytes

Contents

module ApplicationCable
  class Connection < ::ActionCable::Connection::Base
    identified_by :current_user

    def connect
      self.current_user = find_verified_user
    end

    private

    def find_verified_user
      return if cookies.signed[:user_id].blank?

      ::Marty::User.find_by(id: cookies.signed[:user_id])
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
marty-14.3.0 app/channels/application_cable/connection.rb
marty-14.0.0 app/channels/application_cable/connection.rb
marty-13.0.2 app/channels/application_cable/connection.rb
marty-11.0.0 app/channels/application_cable/connection.rb
marty-10.0.3 app/channels/application_cable/connection.rb
marty-10.0.2 app/channels/application_cable/connection.rb
marty-10.0.0 app/channels/application_cable/connection.rb
marty-9.5.1 app/channels/application_cable/connection.rb
marty-9.5.0 app/channels/application_cable/connection.rb
marty-9.3.3 app/channels/application_cable/connection.rb
marty-9.3.2 app/channels/application_cable/connection.rb