{"record":{"id":"56aed6a7cdd2e796","repo":"different-ai/openwork","slug":"failed-to-save-the-oauth-client-response-status","errorCode":null,"errorMessage":"Failed to save the OAuth client (${response.status}).","messagePattern":"Failed to save the OAuth client \\((.+?)\\)\\.","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx","lineNumber":1048,"sourceCode":"        const clientId = input.clientId?.trim();\n        const clientSecret = input.clientSecret?.trim();\n        const tenantId = input.tenantId?.trim();\n        const { response, payload } = await requestJson(\n          `/v1/oauth-providers/${encodeURIComponent(input.providerId)}/client`,\n          {\n            method: \"POST\",\n            headers: getOrgScopeHeaders(requireOrgId(orgId)),\n            body: JSON.stringify({\n              ...(clientId ? { clientId } : {}),\n              ...(clientSecret ? { clientSecret } : {}),\n              ...(tenantId ? { tenantId } : {}),\n              features: input.features,\n            }),\n          },\n          20000,\n        );\n        if (!response.ok) {\n          throw getRequestError(payload, response, `Failed to save the OAuth client (${response.status}).`);\n        }\n      });\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries({ queryKey: mcpConnectionQueryKeys.all });\n    },\n  });\n}\n\nexport function useNativeProviderClient(providerId: string, enabled: boolean) {\n  const { orgId, runReauthableAction } = useOrgDashboard();\n\n  return useQuery({\n    enabled: enabled && Boolean(orgId),\n    queryKey: mcpConnectionQueryKeys.nativeProviderClient(orgId, providerId),\n    retry: false,\n    queryFn: async (): Promise<NativeProviderClient> => {\n      let client: NativeProviderClient | null = null;","sourceCodeStart":1030,"sourceCodeEnd":1066,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx#L1030-L1066","documentation":"Error \"Failed to save the OAuth client (${response.status}).\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx:1048 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}