license test
This commit is contained in:
@@ -29,6 +29,7 @@ class ApplicationController < ActionController::Base
|
|||||||
if (!@license.nil?)
|
if (!@license.nil?)
|
||||||
# logger.info "Location - " + @license.name
|
# logger.info "Location - " + @license.name
|
||||||
ActiveRecord::Base.establish_connection(website_connection(@license))
|
ActiveRecord::Base.establish_connection(website_connection(@license))
|
||||||
|
authentication
|
||||||
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
|
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
|
||||||
else
|
else
|
||||||
# reconnect_default_db
|
# reconnect_default_db
|
||||||
@@ -38,11 +39,11 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
# check for license file
|
# check for license file
|
||||||
if check_license
|
# if check_license
|
||||||
current_license(ENV["SX_PROVISION_URL"])
|
# current_license(ENV["SX_PROVISION_URL"])
|
||||||
else
|
# else
|
||||||
redirect_to activate_path
|
# redirect_to activate_path
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ module LoginVerification
|
|||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
before_action :authenticate
|
# before_action :authenticate
|
||||||
helper_method :current_company,:current_login_employee
|
helper_method :current_company,:current_login_employee
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -18,7 +18,7 @@ module LoginVerification
|
|||||||
token = session[:session_token]
|
token = session[:session_token]
|
||||||
if (token)
|
if (token)
|
||||||
#@current_user = User.find_by(api_key: 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)
|
@user = Employee.authenticate_by_token(token)
|
||||||
if @user
|
if @user
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
development:
|
development:
|
||||||
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
||||||
sx_provision_url: connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
sx_provision_url: 192.168.1.125:3002/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
||||||
server_mode: application
|
server_mode: cloud
|
||||||
cipher_type: AES-256-CBC
|
cipher_type: AES-256-CBC
|
||||||
sx_key: Wh@t1$C2L
|
sx_key: Wh@t1$C2L
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,18 @@
|
|||||||
{
|
{
|
||||||
"data": []
|
"data": [
|
||||||
|
{
|
||||||
|
"lookup": "chromis-1.zsai.ws",
|
||||||
|
"value": {
|
||||||
|
"key": "877eY5iPvpVzaYnIkc2FgIy0U85FtqpTpQGqoM/RCG0=\n",
|
||||||
|
"iv": "qSVQaKzOm3TYmRP3DhHdig==\n"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"lookup": "gw2a-13.zsai.dev",
|
||||||
|
"value": {
|
||||||
|
"key": "R0uRkGlvCD5DGaPV4SkhGlwaMR0ohYBBmNna+tpRXMc=\n",
|
||||||
|
"iv": "AP5iuLM36oJmnvLsWCo9+Q==\n"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user