chore: Use installation config URL for captain app URL (#9874)
Use `InstallationConfig.where(name: 'CAPTAIN_APP_URL')` instead of
`ENV.fetch('CAPTAIN_APP_URL', '')`
This commit is contained in:
@@ -8,7 +8,9 @@ class Api::V1::Accounts::Integrations::CaptainController < Api::V1::Accounts::Ba
|
||||
"&email=#{URI.encode_www_form_component(@hook['settings']['account_email'])}" \
|
||||
"&account_id=#{URI.encode_www_form_component(@hook['settings']['account_id'])}"
|
||||
|
||||
sso_url = "#{ENV.fetch('CAPTAIN_APP_URL', '')}/sso?#{params_string}"
|
||||
installation_config = InstallationConfig.find_by(name: 'CAPTAIN_APP_URL')
|
||||
|
||||
sso_url = "#{installation_config.value}/sso?#{params_string}"
|
||||
render json: { sso_url: sso_url }, status: :ok
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user