Sha256: aee2936c10433c31ba12de37e75103c531067d7fc8f9fbf0bdf6415cef167d89

Contents?: true

Size: 351 Bytes

Versions: 5

Compression:

Stored size: 351 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 unless cookies.signed[:user_id].present?

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
marty-9.3.0 app/channels/application_cable/connection.rb
marty-8.5.0 app/channels/application_cable/connection.rb
marty-8.4.1 app/channels/application_cable/connection.rb
marty-8.3.1 app/channels/application_cable/connection.rb
marty-8.2.0 app/channels/application_cable/connection.rb