The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Update Connection provider path (#21678)
martmull306a1454aaeb
diff --git a/packages/twenty-apps/internal/twenty-linear/README.md b/packages/twenty-apps/internal/twenty-linear/README.mdindex d26c756ddeb..97eadb6f5cf 100644--- a/packages/twenty-apps/internal/twenty-linear/README.md+++ b/packages/twenty-apps/internal/twenty-linear/README.md@@ -40,8 +40,8 @@ this — the OAuth credentials are already configured.### 1. Register an OAuth app in Linear1. Visit https://linear.app/settings/api/applications/new.-2. Set the **Redirect URI** to `<SERVER_URL>/apps/oauth/callback` (for- local dev: `http://localhost:3000/apps/oauth/callback`).+2. Set the **Redirect URI** to `<SERVER_URL>/auth/apps/callback` (for+ local dev: `http://localhost:3000/auth/apps/callback`).3. Copy the generated **Client ID** and **Client Secret**.### 2. Wire the credentials into Twentydiff --git a/packages/twenty-apps/internal/twenty-slack/README.md b/packages/twenty-apps/internal/twenty-slack/README.mdindex 32a5fafb9a5..eec190deabc 100644--- a/packages/twenty-apps/internal/twenty-slack/README.md+++ b/packages/twenty-apps/internal/twenty-slack/README.md@@ -79,7 +79,7 @@ Both routes require an authenticated Twenty user and use the same shared Slack creinstall the Slack app to the workspace) so the token picks up new scopes.3. Set the **Redirect URL** on the Slack app to- `<YOUR_TWENTY_SERVER_URL>/apps/oauth/callback` — the same origin your+ `<YOUR_TWENTY_SERVER_URL>/auth/apps/callback` — the same origin yourTwenty **server** uses for API routes (the callback is not served by the SPAalone). Local monorepo dev often uses `http://localhost:3000` (confirm theport your `twenty-server` / `SERVER_URL` actually uses).diff --git a/packages/twenty-codex-plugin/references/publish-app/prepare-for-app-store.md b/packages/twenty-codex-plugin/references/publish-app/prepare-for-app-store.mdindex 950d3a3b964..8d468c6cb5e 100644--- a/packages/twenty-codex-plugin/references/publish-app/prepare-for-app-store.md+++ b/packages/twenty-codex-plugin/references/publish-app/prepare-for-app-store.md@@ -122,7 +122,7 @@ Use plain product language:- Name the Twenty objects and views users will actually interact with.- Explain setup variables by their exact names.- Distinguish server admin setup from workspace member usage.-- For OAuth connections, mention the provider redirect URI: `<SERVER_URL>/apps/oauth/callback`.+- For OAuth connections, mention the provider redirect URI: `<SERVER_URL>/auth/apps/callback`.- Document permissions in terms of user risk: read, create, update, soft delete, destroy, third-party send.Avoid:diff --git a/packages/twenty-docs/developers/extend/apps/logic/connections.mdx b/packages/twenty-docs/developers/extend/apps/logic/connections.mdxindex 060ebdd17e5..b12f1ff1ada 100644--- a/packages/twenty-docs/developers/extend/apps/logic/connections.mdx+++ b/packages/twenty-docs/developers/extend/apps/logic/connections.mdx@@ -82,7 +82,7 @@ Key points:The OAuth callback URL your provider needs to whitelist is:```-https://<your-twenty-server>/apps/oauth/callback+https://<your-twenty-server>/auth/apps/callback```</Accordion>@@ -182,7 +182,7 @@ Multiple connections per (user, provider) are allowed, so the same user can holdFor each connection provider, the server admin needs to register an OAuth app at the third party first.1. Go to the provider's developer settings (e.g. https://linear.app/settings/api/applications/new).-2. Set the **Redirect URI** to `<SERVER_URL>/apps/oauth/callback`.+2. Set the **Redirect URI** to `<SERVER_URL>/auth/apps/callback`.3. Copy the generated **Client ID** and **Client Secret**.4. Open the installed app in Twenty as a server admin → set the values on the corresponding `serverVariables`.5. Workspace members can then add connections from the per-app **Connections** section.diff --git a/packages/twenty-front/src/pages/settings/applications/hooks/useTriggerAppOAuth.ts b/packages/twenty-front/src/pages/settings/applications/hooks/useTriggerAppOAuth.tsindex 3bc5d5556ef..bb79463e2d3 100644--- a/packages/twenty-front/src/pages/settings/applications/hooks/useTriggerAppOAuth.ts+++ b/packages/twenty-front/src/pages/settings/applications/hooks/useTriggerAppOAuth.ts@@ -7,7 +7,7 @@ import { GenerateTransientTokenDocument } from '~/generated-metadata/graphql';// Mints a transient token then redirects to the generic app OAuth endpoint.// Mirrors `useTriggerApisOAuth` for Google/Microsoft, but the URL template is-// /apps/oauth/authorize and works for any app-declared OAuth provider.+// /auth/apps/authorize and works for any app-declared OAuth provider.export const useTriggerAppOAuth = () => {const [generateTransientToken] = useMutation(GenerateTransientTokenDocument);const { redirect } = useRedirect();@@ -58,7 +58,7 @@ export const useTriggerAppOAuth = () => {}redirect(- `${REACT_APP_SERVER_BASE_URL}/apps/oauth/authorize?${params.toString()}`,+ `${REACT_APP_SERVER_BASE_URL}/auth/apps/authorize?${params.toString()}`,);},[generateTransientToken, redirect],diff --git a/packages/twenty-server/src/engine/core-modules/application/connection-provider/__tests__/connection-provider-oauth-flow.service.spec.ts b/packages/twenty-server/src/engine/core-modules/application/connection-provider/__tests__/connection-provider-oauth-flow.service.spec.tsindex 4057edad3d9..942844f18be 100644--- a/packages/twenty-server/src/engine/core-modules/application/connection-provider/__tests__/connection-provider-oauth-flow.service.spec.ts+++ b/packages/twenty-server/src/engine/core-modules/application/connection-provider/__tests__/connection-provider-oauth-flow.service.spec.ts@@ -172,7 +172,7 @@ describe('ConnectionProviderOAuthFlowService', () => {expect(url.searchParams.get('scope')).toBe('read write');expect(url.searchParams.get('state')).toBe('signed-state-token');expect(url.searchParams.get('redirect_uri')).toBe(- 'https://api.example.com/apps/oauth/callback',+ 'https://api.example.com/auth/apps/callback',);expect(url.searchParams.has('code_challenge')).toBe(false);diff --git a/packages/twenty-server/src/engine/core-modules/application/connection-provider/connection-provider-oauth.controller.ts b/packages/twenty-server/src/engine/core-modules/application/connection-provider/connection-provider-oauth.controller.tsindex 6d288712544..4f881c6c29e 100644--- a/packages/twenty-server/src/engine/core-modules/application/connection-provider/connection-provider-oauth.controller.ts+++ b/packages/twenty-server/src/engine/core-modules/application/connection-provider/connection-provider-oauth.controller.ts@@ -23,7 +23,7 @@ import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entimport { NoPermissionGuard } from 'src/engine/guards/no-permission.guard';import { PublicEndpointGuard } from 'src/engine/guards/public-endpoint.guard';-@Controller('apps/oauth')+@Controller('auth/apps')@UseGuards(PublicEndpointGuard, NoPermissionGuard)export class ConnectionProviderOAuthController {private readonly logger = new Logger(ConnectionProviderOAuthController.name);diff --git a/packages/twenty-server/src/engine/core-modules/application/connection-provider/utils/build-callback-url.util.ts b/packages/twenty-server/src/engine/core-modules/application/connection-provider/utils/build-callback-url.util.tsindex 7bcb5aa026b..c97c918ec68 100644--- a/packages/twenty-server/src/engine/core-modules/application/connection-provider/utils/build-callback-url.util.ts+++ b/packages/twenty-server/src/engine/core-modules/application/connection-provider/utils/build-callback-url.util.ts@@ -2,4 +2,4 @@// signed `state` parameter, so a single redirect URL configured at the// OAuth provider serves every workspace.export const buildAppOAuthCallbackUrl = (serverUrl: string): string =>- new URL('/apps/oauth/callback', serverUrl).toString();+ new URL('/auth/apps/callback', serverUrl).toString();