From 62fa0fa2c1961ee70112e8bc9a9b9e79d268e626 Mon Sep 17 00:00:00 2001 From: parthy007 Date: Wed, 8 May 2024 14:46:16 +0530 Subject: [PATCH] Make the URL dynamic in salesforce form --- frontend/src/_components/Salesforce.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/_components/Salesforce.jsx b/frontend/src/_components/Salesforce.jsx index 8f60eba347..84d06a4ac0 100644 --- a/frontend/src/_components/Salesforce.jsx +++ b/frontend/src/_components/Salesforce.jsx @@ -5,11 +5,15 @@ import { toast } from 'react-hot-toast'; import Button from '@/_ui/Button'; import Select from '@/_ui/Select'; import Input from '@/_ui/Input'; +import config from 'config'; const Salesforce = ({ optionchanged, createDataSource, options, isSaving, selectedDataSource, workspaceConstants }) => { const [authStatus, setAuthStatus] = useState(null); const { t } = useTranslation(); - const redirectUri = `http://localhost:8082/oauth2/authorize`; + const hostUrl = window.public_config?.TOOLJET_HOST; + const subPathUrl = window.public_config?.SUB_PATH; + const fullUrl = `${hostUrl}${subPathUrl ? subPathUrl : '/'}oauth2/authorize`; + const redirectUri = fullUrl; const selectOptions = [ { value: 'v1', label: 'v1' }, { value: 'v2', label: 'v2' },