count-anything/app/channels/application_cable/connection.rb

19 lines
336 B
Ruby
Raw Normal View History

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
if (verified_user = env['warden'].user)
verified_user
else
nil
end
end
end
end