I am developing multi-tenant rails app without using apartment gem. I have a problem with user authentication using devise.
When I sign up my user session is not shared across all subdomains. I found that I need to change session configuration and here is how looks my config:
Rails.application.config.session_store :cookie_store, key: '_hyggebulk_session', domain: 'lvh.me', tld_length: 2
here is my routes.rb:
Rails.application.routes.draw do
devise_for :users, controllers: { registrations: "registrations" }
constraints(SubdomainRequired) do
root to: "backend/dashboard#index", as: :authenticated_root
end
root to: "backend/dashboard#index"
end
I think that there is some little problem with my code, so please help me.