diegosouzapw/OmniRoute · error · ClaudeAuthFileError

missing_refresh_token

missing_refresh_token

Error message

refreshToken is missing or empty in claudeAiOauth

What it means

Error "refreshToken is missing or empty in claudeAiOauth" thrown in diegosouzapw/OmniRoute.

Source

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

// ──── Parse & validate ────────────────────────────────────────────────────────

export function parseAndValidateClaudeAuth(raw: unknown): ParsedClaudeAuth {
  const doc = toRecord(raw);
  const oauthBlock = toRecord(doc.claudeAiOauth);

  const accessToken = toNonEmptyString(oauthBlock.accessToken);
  const refreshToken = toNonEmptyString(oauthBlock.refreshToken);

  if (!accessToken) {
    throw new ClaudeAuthFileError(
      "accessToken is missing or empty in claudeAiOauth",
      400,
      "missing_access_token"
    );
  }

  if (!refreshToken) {
    throw new ClaudeAuthFileError(
      "refreshToken is missing or empty in claudeAiOauth",
      400,
      "missing_refresh_token"
    );
  }

  // expiresAt in the file is ms epoch; store as ISO in DB
  let expiresAt: string | null = null;
  const rawExpiresAt = oauthBlock.expiresAt;
  if (typeof rawExpiresAt === "number" && Number.isFinite(rawExpiresAt)) {
    expiresAt = new Date(rawExpiresAt).toISOString();
  } else if (typeof rawExpiresAt === "string" && rawExpiresAt.trim()) {
    expiresAt = rawExpiresAt.trim();
  }

  const rawScopes = oauthBlock.scopes;
  const scopes: string[] = Array.isArray(rawScopes)
    ? rawScopes.filter((s): s is string => typeof s === "string")

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/oauth/utils/claudeAuthImport.ts:66 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/3bbb4bae680f25bf. Report an issue: GitHub.