Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Remove SITE_URL from frontend

Tuan Dang1447e055d14b
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 4d6c3fe86f..2a21e7ed37 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -52,7 +52,6 @@ services:
environment:
- NEXT_PUBLIC_ENV=development
- INFISICAL_TELEMETRY_ENABLED=${TELEMETRY_ENABLED}
- - NEXT_PUBLIC_SITE_URL=${SITE_URL}
- NEXT_PUBLIC_STRIPE_PRODUCT_PRO=${STRIPE_PRODUCT_PRO}
- NEXT_PUBLIC_STRIPE_PRODUCT_STARTER=${STRIPE_PRODUCT_STARTER}
- NEXT_PUBLIC_CLIENT_ID_HEROKU=${CLIENT_ID_HEROKU}
diff --git a/docker-compose.yml b/docker-compose.yml
index 366b512db9..9fce7010ac 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -41,7 +41,6 @@ services:
- INFISICAL_TELEMETRY_ENABLED=${TELEMETRY_ENABLED}
- NEXT_PUBLIC_STRIPE_PRODUCT_PRO=${STRIPE_PRODUCT_PRO}
- NEXT_PUBLIC_STRIPE_PRODUCT_STARTER=${STRIPE_PRODUCT_STARTER}
- - NEXT_PUBLIC_SITE_URL=${SITE_URL}
- NEXT_PUBLIC_CLIENT_ID_HEROKU=${CLIENT_ID_HEROKU}
- NEXT_PUBLIC_CLIENT_ID_NETLIFY=${CLIENT_ID_NETLIFY}
networks:
diff --git a/frontend/components/utilities/config/index.ts b/frontend/components/utilities/config/index.ts
index 256c350a8d..42dee56188 100644
--- a/frontend/components/utilities/config/index.ts
+++ b/frontend/components/utilities/config/index.ts
@@ -4,7 +4,6 @@ const POSTHOG_HOST =
process.env.NEXT_PUBLIC_POSTHOG_HOST! || "https://app.posthog.com";
const STRIPE_PRODUCT_PRO = process.env.NEXT_PUBLIC_STRIPE_PRODUCT_PRO!;
const STRIPE_PRODUCT_STARTER = process.env.NEXT_PUBLIC_STRIPE_PRODUCT_STARTER!;
-const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL!;
const CLIENT_ID_HEROKU = process.env.NEXT_PUBLIC_CLIENT_ID_HEROKU!;
const CLIENT_ID_NETLIFY = process.env.NEXT_PUBLIC_CLIENT_ID_NETLIFY!;
@@ -14,7 +13,6 @@ export {
POSTHOG_HOST,
STRIPE_PRODUCT_PRO,
STRIPE_PRODUCT_STARTER,
- SITE_URL,
CLIENT_ID_HEROKU,
CLIENT_ID_NETLIFY
};
\ No newline at end of file
diff --git a/frontend/pages/integrations/[id].js b/frontend/pages/integrations/[id].js
index 335fc4d40e..734df7d953 100644
--- a/frontend/pages/integrations/[id].js
+++ b/frontend/pages/integrations/[id].js
@@ -118,6 +118,7 @@ export default function Integrations() {
* @returns
*/
const handleIntegrationOption = async ({ integrationOption }) => {
+
try {
// generate CSRF token for OAuth2 code-token exchange integrations
const state = crypto.randomBytes(16).toString("hex");
@@ -131,7 +132,7 @@ export default function Integrations() {
window.location = `https://vercel.com/integrations/infisical-dev/new?state=${state}`;
break;
case 'Netlify':
- window.location = `https://app.netlify.com/authorize?client_id=${integrationOption.clientId}&response_type=code&state=${state}&redirect_uri=${integrationOption.redirectURL}`;
+ window.location = `https://app.netlify.com/authorize?client_id=${integrationOption.clientId}&response_type=code&state=${state}&redirect_uri=${window.location.origin}`;
break;
// case 'Fly.io':
// console.log('fly.io');
diff --git a/frontend/public/data/cloudIntegrations.js b/frontend/public/data/cloudIntegrations.js
index e86ceb0557..694b4d519d 100644
--- a/frontend/public/data/cloudIntegrations.js
+++ b/frontend/public/data/cloudIntegrations.js
@@ -1,5 +1,4 @@
import {
- SITE_URL,
CLIENT_ID_HEROKU,
CLIENT_ID_NETLIFY
} from '../../components/utilities/config';
@@ -30,7 +29,6 @@ const cloudIntegrationOptions = [
isAvailable: true,
type: 'oauth2',
clientId: CLIENT_ID_NETLIFY,
- redirectURL: `${SITE_URL}/netlify`,
docsLink: ''
},
{