chromesetting
jingquan huang 5 years ago
parent 57e8bb59d6
commit cc76f56969

@ -293,7 +293,9 @@ class ApplicationController < ActionController::Base
def find_current_user
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}"]
# existing session
(User.active.find(session[:"#{re_subdomain}"]) rescue nil)

Loading…
Cancel
Save