Skip to content

Commit b7c937d

Browse files
waleedlatif1claude
andcommitted
fix(mcp): normalize empty-string oauthClientId at route boundary
Orchestration already converts falsy → null via `|| null` (server-lifecycle.ts), so the DB was never receiving an empty string. Tightening the route layer to match the same convention keeps the boundary contract consistent and avoids relying on downstream normalization. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 05c4bc1 commit b7c937d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

apps/sim/app/api/mcp/servers/[id]/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const PATCH = withRouteHandler(
6060
retries: body.retries,
6161
enabled: body.enabled,
6262
authType: body.authType,
63-
oauthClientId: body.oauthClientId ?? null,
63+
oauthClientId: body.oauthClientId || null,
6464
oauthClientIdProvided: body.oauthClientId !== undefined,
6565
oauthClientSecret: body.oauthClientSecret,
6666
oauthClientSecretProvided: body.oauthClientSecret !== undefined,

apps/sim/app/api/mcp/servers/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const POST = withRouteHandler(
9595
enabled: body.enabled,
9696
source,
9797
authType: body.authType,
98-
oauthClientId: body.oauthClientId ?? null,
98+
oauthClientId: body.oauthClientId || null,
9999
oauthClientIdProvided: body.oauthClientId !== undefined,
100100
oauthClientSecret: body.oauthClientSecret,
101101
oauthClientSecretProvided: body.oauthClientSecret !== undefined,

0 commit comments

Comments
 (0)