I am not even sure the right question.
I installed ActionCable to open the connection to the web server, and it works fine for the hero if it is just app-name.herokuapp.com But when I try to use the custom domain configured for the application, the connection is not checked.
So, I am trying to set a cookie on the client to verify the user
Channels / application_cable / connection.rb
module ApplicationCable class Connection < ActionCable::Connection::Base identified_by :current_user def connect self.current_user = find_verified_user logger.add_tags 'ActionCable', current_user.email end protected def find_verified_user
On example.com - it continues to work as an unauthorized connection. But app-name.herokuapp.com is connectiong fine.
Initializers / warden_hooks.rb
Warden::Manager.after_set_user do |user,auth,opts| scope = opts[:scope] auth.cookies.signed["#{scope}.id"] = user.id end
I am trying to resolve calls from herokuapp.com and example.com: environment /production.rb
Rails.application.configure do config.action_cable.url = 'wss://app-name.herokuapp.com//cable' config.action_cable.allowed_request_origins = [ 'https://www.example.com', /http:\/\/www.example.com.*/, 'https://app-name.herokuapp.com', /http:\/\/app-name.herokuapp.com.*/ ] end
Why is it not verified in the user domain? How can I set a cookie variable to validate it? What I do not understand about this concept?
Thanks!
PS. Of course, someone is trying to add as an "answer" - YES I changed the name to example.com and app-name.herokuapp.com for this message, and NO this does not say that in my code :)