diff --git a/app/controllers/concerns/token_verification.rb b/app/controllers/concerns/token_verification.rb index 85c9b858..b49ef597 100755 --- a/app/controllers/concerns/token_verification.rb +++ b/app/controllers/concerns/token_verification.rb @@ -24,8 +24,7 @@ module TokenVerification end end - @user = Employee. - (token) + @user = Employee.authenticate_by_token(token) if @user return true #Maybe log - login? diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index a3b19ebe..b84bca54 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -8,7 +8,7 @@ class 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.dbhost + logger.info "Location - " + @license.dbschema ActiveRecord::Base.establish_connection(website_connection(@license)) # authenticate_session_token # logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema @@ -97,7 +97,7 @@ class ActionController::API 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.dbhost + logger.info "Location - " + @license.dbschema ActiveRecord::Base.establish_connection(website_connection(@license)) # authenticate_session_token # logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema diff --git a/config/secrets.yml b/config/secrets.yml index b0d7c5c8..218234f1 100755 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -13,7 +13,7 @@ development: secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61 sx_provision_url: https://connect.pos-myanmar.com/bensai/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api - server_mode: cloud + server_mode: application cipher_type: AES-256-CBC sx_key: Wh@t1$C2L