This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationCable | |
class Connection < ActionCable::Base::Connection | |
# we need to keep tenant information for subsequent messages, | |
# so let's store it as an identifier | |
identified_by :tenant | |
def connect | |
# assuming you store current tenant in session | |
self.tenant = request.session[:current_tenant] | |
reject_unauthorized_connection unless tenant |