From 11dbcaf80c85ee6b336de3fda01bcfb4713024c1 Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Mon, 19 Aug 2024 19:53:51 -0400 Subject: [PATCH] Use Setting.host_name & path --- app/controllers/qbo_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/qbo_controller.rb b/app/controllers/qbo_controller.rb index 442fb43..c3c10ed 100644 --- a/app/controllers/qbo_controller.rb +++ b/app/controllers/qbo_controller.rb @@ -27,7 +27,7 @@ class QboController < ApplicationController # def authenticate oauth2_client = Qbo.construct_oauth2_client - grant_url = oauth2_client.auth_code.authorize_url(redirect_uri: qbo_oauth_callback_path, response_type: "code", state: SecureRandom.hex(12), scope: "com.intuit.quickbooks.accounting") + grant_url = oauth2_client.auth_code.authorize_url(redirect_uri: Setting.host_name + qbo_oauth_callback_path, response_type: "code", state: SecureRandom.hex(12), scope: "com.intuit.quickbooks.accounting") redirect_to grant_url end @@ -38,7 +38,7 @@ class QboController < ApplicationController if params[:state].present? oauth2_client = Qbo.construct_oauth2_client # use the state value to retrieve from your backend any information you need to identify the customer in your system - redirect_uri = Setting.host_name + "/qbo/oauth_callback/" + redirect_uri = Setting.host_name + qbo_oauth_callback_path if resp = oauth2_client.auth_code.get_token(params[:code], redirect_uri: redirect_uri) # Remove the last authentication information