license test
This commit is contained in:
@@ -27,8 +27,9 @@ class ApplicationController < ActionController::Base
|
||||
from = request.subdomain.downcase + "." + request.domain.downcase
|
||||
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
|
||||
if (!@license.nil?)
|
||||
# logger.info "Location - " + @license.name
|
||||
# logger.info "Location - " + @license.name
|
||||
ActiveRecord::Base.establish_connection(website_connection(@license))
|
||||
authentication
|
||||
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
|
||||
else
|
||||
# reconnect_default_db
|
||||
@@ -38,11 +39,11 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
else
|
||||
# check for license file
|
||||
if check_license
|
||||
current_license(ENV["SX_PROVISION_URL"])
|
||||
else
|
||||
redirect_to activate_path
|
||||
end
|
||||
# if check_license
|
||||
# current_license(ENV["SX_PROVISION_URL"])
|
||||
# else
|
||||
# redirect_to activate_path
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ module LoginVerification
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
before_action :authenticate
|
||||
# before_action :authenticate
|
||||
helper_method :current_company,:current_login_employee
|
||||
|
||||
end
|
||||
@@ -10,7 +10,7 @@ module LoginVerification
|
||||
|
||||
protected
|
||||
# Authenticate the user with token based authentication
|
||||
def authenticate
|
||||
def authenticate
|
||||
authenticate_session_token || render_unauthorized
|
||||
end
|
||||
|
||||
@@ -18,7 +18,7 @@ module LoginVerification
|
||||
token = session[:session_token]
|
||||
if (token)
|
||||
#@current_user = User.find_by(api_key: token)
|
||||
Rails.logger.debug "token - " + token.to_s
|
||||
#Rails.logger.debug "token - " + token.to_s
|
||||
|
||||
@user = Employee.authenticate_by_token(token)
|
||||
if @user
|
||||
|
||||
@@ -33,7 +33,7 @@ class License
|
||||
##Get redis connection from connection pool
|
||||
redis = Redis.new
|
||||
cache_license = redis.get(cache_key)
|
||||
|
||||
|
||||
Rails.logger.info "Cache key - " + cache_key.to_s
|
||||
if cache_license.nil?
|
||||
##change the d/e key
|
||||
|
||||
Reference in New Issue
Block a user