|
|
@ -293,7 +293,9 @@ class ApplicationController < ActionController::Base
|
|
|
|
def find_current_user
|
|
|
|
def find_current_user
|
|
|
|
re_subdomain = "#{request.subdomain.split('.').first}_user_id"
|
|
|
|
re_subdomain = "#{request.subdomain.split('.').first}_user_id"
|
|
|
|
|
|
|
|
|
|
|
|
Rails.logger.info("find current_user: subdomain is #{request.subdomain} and user session is #{session[:user_id]} -- #{session[:"#{re_subdomain}"]}")
|
|
|
|
Rails.logger.info("find current_user: subdomain is #{re_subdomain} and user session is #{session[:user_id]} -- #{session[:"#{re_subdomain}"]}")
|
|
|
|
|
|
|
|
Rails.logger.info("-----------------------------")
|
|
|
|
|
|
|
|
Rails.logger.info("domain session is: #{session[:"#{request.subdomain.split('.').first}_user_id"]}")
|
|
|
|
if session[:"#{re_subdomain}"]
|
|
|
|
if session[:"#{re_subdomain}"]
|
|
|
|
# existing session
|
|
|
|
# existing session
|
|
|
|
(User.active.find(session[:"#{re_subdomain}"]) rescue nil)
|
|
|
|
(User.active.find(session[:"#{re_subdomain}"]) rescue nil)
|
|
|
|