{"record":{"id":"d987eb7d998e8a8b","repo":"nextauthjs/next-auth","slug":"callback-for-provider-type-provider-type-is-n","errorCode":null,"errorMessage":"Callback for provider type (${provider.type}) is not supported","messagePattern":"Callback for provider type \\((.+?)\\) is not supported","errorType":"exception","errorClass":"InvalidProvider","httpStatus":null,"severity":"error","filePath":"packages/core/src/lib/actions/callback/index.ts","lineNumber":528,"sourceCode":"      })\n\n      // Handle first logins on new accounts\n      // e.g. option to send users to a new account landing page on initial login\n      // Note that the callback URL is preserved, so the journey can still be resumed\n      if (isNewUser && pages.newUser) {\n        return {\n          redirect: `${pages.newUser}${\n            pages.newUser.includes(\"?\") ? \"&\" : \"?\"\n          }${new URLSearchParams({ callbackUrl })}`,\n          cookies,\n        }\n      }\n\n      // Callback URL is already verified at this point, so safe to use if specified\n      return { redirect: callbackUrl, cookies }\n    }\n\n    throw new InvalidProvider(\n      `Callback for provider type (${provider.type}) is not supported`\n    )\n  } catch (e) {\n    if (e instanceof AuthError) throw e\n    const error = new CallbackRouteError(e as Error, { provider: provider.id })\n    logger.debug(\"callback route error details\", { method, query, body })\n    throw error\n  }\n}\n\nasync function handleAuthorized(\n  params: Parameters<InternalOptions[\"callbacks\"][\"signIn\"]>[0],\n  config: InternalOptions\n): Promise<string | undefined> {\n  let authorized\n  const { signIn, redirect } = config.callbacks\n  try {\n    authorized = await signIn(params)","sourceCodeStart":510,"sourceCodeEnd":546,"githubUrl":"https://github.com/nextauthjs/next-auth/blob/a1a16a5a7780488c7449feece410033f445d0b31/packages/core/src/lib/actions/callback/index.ts#L510-L546","documentation":"InvalidProvider is thrown at the end of the callback route when the resolved provider's type does not match any supported callback branch (oauth/oidc/credentials/email/webauthn already handled earlier). It means Auth.js was asked to process a callback for a provider type it cannot handle in that route.","triggerScenarios":"Requesting /api/auth/callback/<id> where <id> resolves to a provider whose type is unsupported for callbacks — e.g. a custom provider object with a mistyped or unrecognized `type` field, or calling the callback route for a provider that only supports sign-in (not callback processing).","commonSituations":"Defining a custom provider with type set to an arbitrary string instead of a supported value; typos like type: \"oauth2\" instead of \"oauth\"; version upgrades where a previously accepted provider type was removed; pointing the client at the wrong provider id in the callback URL.","solutions":["Set the provider's `type` to a supported value: \"oauth\", \"oidc\", \"credentials\", \"email\", or \"webauthn\"","Verify the provider id in the callback URL matches a provider defined in your auth config","Upgrade/downgrade @auth/core and provider packages to compatible versions so provider types align","For custom providers, extend the OIDC or OAuth template rather than inventing a new type"],"exampleFix":"// before\nconst MyProvider = { id: \"myid\", type: \"oauth2\", ... }\n// after\nconst MyProvider = { id: \"myid\", type: \"oidc\", issuer: \"https://...\", ... }","handlingStrategy":"validation","validationCode":"const supported = [\"oauth\", \"oidc\", \"credentials\", \"email\", \"webauthn\"]\nfor (const p of providers) {\n  if (!supported.includes(p.type)) {\n    throw new Error(`Provider ${p.id} has unsupported type: ${p.type}`)\n  }\n}","typeGuard":"function isSupportedProviderType(t: string): boolean {\n  return [\"oauth\",\"oidc\",\"credentials\",\"email\",\"webauthn\"].includes(t)\n}","tryCatchPattern":"try {\n  await signIn(providerId)\n} catch (e) {\n  if ((e as Error).message.startsWith(\"Callback for provider type\")) {\n    // fix provider `type` in auth config\n  }\n}","preventionTips":["Use provider presets from @auth/core/providers instead of hand-rolled definitions","Only use supported `type` values in custom providers","Verify the provider id used in URLs matches config keys","Re-check provider definitions after upgrading @auth/core"],"tags":["provider","configuration","routing"],"backgroundTag":"unsupported-provider-type","analyzedSha":"a1a16a5a7780488c7449feece410033f445d0b31","analyzedAt":"2026-08-28T21:52:38.200Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}