Class: Lanes::API::Cable::Connection

Inherits:
ActionCable::Connection::Base
  • Object
show all
Defined in:
lib/lanes/api/cable.rb

Instance Method Summary collapse

Instance Method Details

#connectObject



20
21
22
23
24
25
26
27
28
# File 'lib/lanes/api/cable.rb', line 20

def connect
    unless cookies['user_id'] &&
            self.current_user = Lanes::User
                                    .where(id: cookies['user_id']).first
        Lanes.logger.warn("Rejecting ws connection due to unauthorized access by user_id #{cookies['user_id']}")

        reject_unauthorized_connection
    end
end