Manuel Bustillo 45b16598e3 Revert "Add copyright notice"
This reverts commit 134bf27955e6caab0f7cc731f72551daae6f2a17.
2024-11-30 10:44:22 +01:00

17 lines
374 B
Ruby

module ApplicationCable
class Connection < ActionCable::Connection::Base
identified_by :current_user
def connect
set_current_user || reject_unauthorized_connection
end
private
def set_current_user
if session = Session.find_by(id: cookies.signed[:session_id])
self.current_user = session.user
end
end
end
end