diff --git a/backend/src/integrations/sync.ts b/backend/src/integrations/sync.ts index ca1ea75277..5d8efa1019 100644 --- a/backend/src/integrations/sync.ts +++ b/backend/src/integrations/sync.ts @@ -1167,12 +1167,20 @@ const syncSecretsLaravelForge = async ({ accessId: string | null; accessToken: string; }) => { + + function transformObjectToString(obj: any) { + let result = ""; + for (const key in obj) { + result += `${key}=${obj[key]}\n`; + } + return result; + } + await standardRequest.put( `${INTEGRATION_LARAVELFORGE_API_URL}/api/v1/servers/${accessId}/sites/${integration.appId}/env`, - Object.keys(secrets).map((key) => ({ - key, - value: secrets[key], - })), + { + content: transformObjectToString(secrets), + }, { headers: { Authorization: `Bearer ${accessToken}`, @@ -1890,7 +1898,7 @@ const syncSecretsCloudflarePages = async ({ } ) ) - .data.result['deployment_configs'][integration.targetEnvironment]['env_vars']; + .data.result["deployment_configs"][integration.targetEnvironment]["env_vars"]; // copy the secrets object, so we can set deleted keys to null const secretsObj: any = {...secrets}; diff --git a/backend/src/models/integrationAuth.ts b/backend/src/models/integrationAuth.ts index 4cc7ef5302..ed3dabadfb 100644 --- a/backend/src/models/integrationAuth.ts +++ b/backend/src/models/integrationAuth.ts @@ -19,13 +19,13 @@ import { INTEGRATION_RENDER, INTEGRATION_SUPABASE, INTEGRATION_TRAVISCI, - INTEGRATION_VERCEL, + INTEGRATION_VERCEL } from "../variables"; export interface IIntegrationAuth extends Document { _id: Types.ObjectId; workspace: Types.ObjectId; - integration: 'heroku' | 'vercel' | 'netlify' | 'github' | 'gitlab' | 'render' | 'railway' | 'flyio' | 'azure-key-vault' | 'laravel-forge' | 'circleci' | 'travisci' | 'supabase' | 'aws-parameter-store' | 'aws-secret-manager' | 'checkly' | 'cloudflare-pages'; + integration: "heroku" | "vercel" | "netlify" | "github" | "gitlab" | "render" | "railway" | "flyio" | "azure-key-vault" | "laravel-forge" | "circleci" | "travisci" | "supabase" | "aws-parameter-store" | "aws-secret-manager" | "checkly" | "cloudflare-pages"; teamId: string; accountId: string; url: string; diff --git a/frontend/src/pages/integrations/laravel-forge/authorize.tsx b/frontend/src/pages/integrations/laravel-forge/authorize.tsx index db47dc2507..d69b263e97 100644 --- a/frontend/src/pages/integrations/laravel-forge/authorize.tsx +++ b/frontend/src/pages/integrations/laravel-forge/authorize.tsx @@ -17,9 +17,13 @@ export default function LaravelForgeCreateIntegrationPage() { setApiKeyErrorText(""); setServerIdErrorText(""); - if (apiKey.length === 0 || serverId.length === 0) { - if (apiKey.length === 0) setApiKeyErrorText("Access Token cannot be blank"); - if (serverId.length === 0) setServerIdErrorText("Server Id cannot be blank"); + if (apiKey.length === 0) { + setApiKeyErrorText("Access Token cannot be blank"); + return; + } + + if (serverId.length === 0) { + setServerIdErrorText("Server Id cannot be blank"); return; } @@ -54,11 +58,11 @@ export default function LaravelForgeCreateIntegrationPage() { setApiKey(e.target.value)} /> - setServerId(e.target.value)} /> + setServerId(e.target.value)} />