generate redirect_uri protocol based one site settings

This commit is contained in:
2025-06-16 22:30:30 -04:00
parent 43c7374c42
commit 4d85c24872

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT) #The MIT License (MIT)
# #
#Copyright (c) 2024 rick barrette #Copyright (c) 2016 - 2025 rick barrette
# #
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# #
@@ -39,7 +39,7 @@ class QboController < ApplicationController
if params[:state].present? if params[:state].present?
oauth2_client = Qbo.construct_oauth2_client 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 # use the state value to retrieve from your backend any information you need to identify the customer in your system
redirect_uri = "https://" + Setting.host_name + qbo_oauth_callback_path redirect_uri = "#{Setting.protocol}://#{Setting.host_name + qbo_oauth_callback_path}"
if resp = oauth2_client.auth_code.get_token(params[:code], redirect_uri: redirect_uri) if resp = oauth2_client.auth_code.get_token(params[:code], redirect_uri: redirect_uri)
# Remove the last authentication information # Remove the last authentication information