Class: ApplicationCable::Connection

Inherits:
ActionCable::Connection::Base
  • Object
show all
Defined in:
app/channels/application_cable/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#wardenObject (readonly)

Returns the value of attribute warden.



26
27
28
# File 'app/channels/application_cable/connection.rb', line 26

def warden
  @warden
end

Instance Method Details

#connectObject



28
29
30
31
32
33
34
# File 'app/channels/application_cable/connection.rb', line 28

def connect
  # Only allow connections from CRM subdomain with authenticated users
  reject_unauthorized_connection unless crm_subdomain? && authenticated_user?

  self. = env['warden'].user
  @warden = env['warden']
end