remix-run/remix · error · Error

${getOAuthErrorMessage(json, options.fallbackError)}

Error message

${getOAuthErrorMessage(json, options.fallbackError)}

What it means

Error "${getOAuthErrorMessage(json, options.fallbackError)}" thrown in remix-run/remix.

Source

Thrown at packages/auth/src/lib/provider.ts:294

  let response = await fetch(options.tokenEndpoint, {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/x-www-form-urlencoded',
      ...(clientAuthentication === 'basic'
        ? {
            Authorization: `Basic ${encodeBasicAuth(options.clientId, options.clientSecret)}`,
          }
        : undefined),
      ...options.headers,
    },
    body: params,
  })
  let json = await readJson(response)

  if (!response.ok || hasOAuthError(json)) {
    throw new Error(getOAuthErrorMessage(json, options.fallbackError))
  }

  return normalizeOAuthTokenResponse(json)
}

function normalizeOAuthTokenResponse(json: unknown): OAuthTokens {
  if (typeof json !== 'object' || json == null || Array.isArray(json)) {
    throw new Error('Expected OAuth provider to return a JSON object.')
  }

  let data = json as Record<string, unknown>

  if (typeof data.access_token !== 'string' || data.access_token.length === 0) {
    throw new Error('OAuth token response did not include an access token.')
  }

  return {
    accessToken: data.access_token,

View on GitHub (pinned to 9696913134)

When it happens

Trigger: Thrown at packages/auth/src/lib/provider.ts:294 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of remix-run/remix@9696913134 (2026-08-27). Data as JSON: /api/errors/b160f90751c9efc8. Report an issue: GitHub.