{"record":{"id":"3cd7729f639ab673","repo":"diegosouzapw/OmniRoute","slug":"failed-to-import-credentials","errorCode":null,"errorMessage":"Failed to import credentials","messagePattern":"Failed to import credentials","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/shared/components/oauthBlobSubmit.ts","lineNumber":38,"sourceCode":" * advances the modal to the success step and fires onSuccess; on failure it\n * THROWS so the caller's existing try/catch surfaces the error (keeps the modal\n * call site to two lines). Decoding + finalize + persist happen server-side.\n */\nexport async function submitCredentialBlob(\n  provider: string,\n  blob: string,\n  reauthConnection: { id?: string } | null | undefined,\n  setStep: (s: string) => void,\n  onSuccess?: () => void\n): Promise<void> {\n  const res = await fetch(`/api/oauth/${provider}/paste-credentials`, {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify({ blob: blob.trim(), connectionId: reauthConnection?.id }),\n  });\n  const data = (await parseResponseBody(res)) as Record<string, unknown>;\n  if (!res.ok) {\n    throw new Error(getErrorMessage(data, res.status, \"Failed to import credentials\"));\n  }\n  setStep(\"success\");\n  onSuccess?.();\n}\n","sourceCodeStart":20,"sourceCodeEnd":43,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/components/oauthBlobSubmit.ts#L20-L43","documentation":"User-facing failure label shown by the OAuth credential-paste modal when POST /api/oauth/{provider}/paste-credentials rejects the submitted blob — the server-side decode/finalize/persist step failed, so the pasted credentials could not be imported as a provider connection. The detailed cause is in the server response.","triggerScenarios":"Thrown at src/shared/components/oauthBlobSubmit.ts:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-copy the credential blob — it may be truncated or corrupted in transit","Confirm the blob belongs to the selected provider and has not expired","Check server logs for the underlying decode/finalize error from paste-credentials","Retry the paste after fixing the blob format expected by the provider's OAuth flow"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}