diff --git a/src/routes/integrations.js b/src/routes/integrations.js index 47a316a..f1381a7 100644 --- a/src/routes/integrations.js +++ b/src/routes/integrations.js @@ -161,7 +161,7 @@ export async function integrationRoutes(app) { try { if (!creds.graphql_endpoint || !creds.graphql_username || !creds.graphql_password || !creds.graphql_client_id) throw new Error('GraphQL endpoint, username, password and client ID are required') - const base = creds.graphql_endpoint.replace(/\/$/, '') + const base = new URL(creds.graphql_endpoint).origin const tokenRes = await fetch(`${base}/Token`, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' },