diegosouzapw/OmniRoute · error · ClaudeAuthFileError

duplicate_account

duplicate_account

Error message

A Claude connection for this account already exists. Pass overwriteExisting: true to replace it.

What it means

Error "A Claude connection for this account already exists. Pass overwriteExisting: true to replace it." thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/oauth/utils/claudeAuthImport.ts:188

      const stored = toNonEmptyString(psd.accountUUID);
      return stored !== null && stored.toLowerCase() === lower;
    }) as JsonRecord | undefined) ?? null
  );
}

// ──── Create / update connection ──────────────────────────────────────────────

export async function createConnectionFromAuthFile(
  enriched: EnrichedClaudeAuth,
  options: CreateConnectionOptions
): Promise<{ connection: JsonRecord; created: boolean }> {
  // Duplicate detection by accountUUID (skipped when bootstrap failed)
  if (enriched.accountUUID) {
    const existing = await findExistingClaudeConnection(enriched.accountUUID);

    if (existing) {
      if (!options.overwriteExisting) {
        throw new ClaudeAuthFileError(
          "A Claude connection for this account already exists. Pass overwriteExisting: true to replace it.",
          409,
          "duplicate_account"
        );
      }

      const updated = await updateProviderConnection(existing.id as string, {
        accessToken: enriched.accessToken,
        refreshToken: enriched.refreshToken,
        expiresAt: enriched.expiresAt,
        email:
          options.email || enriched.email || (existing.email as string | undefined) || undefined,
        name:
          options.name ||
          (existing.name as string | undefined) ||
          options.email ||
          enriched.email ||
          "Claude (imported)",

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/oauth/utils/claudeAuthImport.ts:188 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/4935c699b3111e8d. Report an issue: GitHub.