{"record":{"id":"cd77d9c6353fc475","repo":"nextauthjs/next-auth","slug":"provider-id-provider-refers-to-a-webauthn-pro","errorCode":null,"errorMessage":"Provider id \"${provider}\" refers to a WebAuthn provider.\nPlease use `import { signIn } from \"next-auth/webauthn\"` instead.","messagePattern":"Provider id \"(.+?)\" refers to a WebAuthn provider\\.\nPlease use `import (.+?) from \"next-auth/webauthn\"` instead\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/next-auth/src/react.tsx","lineNumber":271,"sourceCode":"  if (!providers) {\n    const url = `${baseUrl}/error`\n    window.location.href = url\n    return // TODO: Return error if `redirect: false`\n  }\n\n  if (!provider || !providers[provider]) {\n    const url = `${baseUrl}/signin?${new URLSearchParams({\n      callbackUrl: redirectTo,\n    })}`\n    window.location.href = url\n    return // TODO: Return error if `redirect: false`\n  }\n\n  const providerType = providers[provider].type\n\n  if (providerType === \"webauthn\") {\n    // TODO: Add docs link with explanation\n    throw new TypeError(\n      [\n        `Provider id \"${provider}\" refers to a WebAuthn provider.`,\n        'Please use `import { signIn } from \"next-auth/webauthn\"` instead.',\n      ].join(\"\\n\")\n    )\n  }\n\n  const signInUrl = `${baseUrl}/${\n    providerType === \"credentials\" ? \"callback\" : \"signin\"\n  }/${provider}`\n\n  const csrfToken = await getCsrfToken()\n  const res = await fetch(\n    `${signInUrl}?${new URLSearchParams(authorizationParams)}`,\n    {\n      method: \"post\",\n      headers: {\n        \"Content-Type\": \"application/x-www-form-urlencoded\",","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/nextauthjs/next-auth/blob/a1a16a5a7780488c7449feece410033f445d0b31/packages/next-auth/src/react.tsx#L253-L289","documentation":"The generic signIn helper from \"next-auth/react\" refuses to handle WebAuthn providers in v5; passkeys must go through the dedicated signIn in \"next-auth/webauthn\". When the resolved provider's type is \"webauthn\", this TypeError is thrown to redirect you to the correct entry point.","triggerScenarios":"Calling `signIn(\"webauthn\")` (or any provider id whose type is \"webauthn\") imported from \"next-auth/react\".","commonSituations":"Upgrading a v4 passkey sign-in flow that used the generic react signIn; copy-pasting a signIn(\"webauthn\") call from older docs; mixing the react and webauthn entry points in one component.","solutions":["Import signIn from \"next-auth/webauthn\" and call it with the WebAuthn provider id","Keep using \"next-auth/react\" signIn only for credentials/oauth/email providers","Route dynamically: check the provider type against your providers list and pick the matching signIn"],"exampleFix":"// before\nimport { signIn } from \"next-auth/react\"\nsignIn(\"webauthn\") // TypeError\n// after\nimport { signIn } from \"next-auth/webauthn\"\nsignIn(\"webauthn\")","handlingStrategy":"type-guard","validationCode":"const providers = await getProviders()\nif (providers?.[providerId]?.type === \"webauthn\") {\n  const { signIn } = await import(\"next-auth/webauthn\")\n  return signIn(providerId)\n}\nconst { signIn } = await import(\"next-auth/react\")\nreturn signIn(providerId)","typeGuard":"function isWebAuthnProviderId(\n  providers: Record<string, { type: string }> | null,\n  id: string\n): boolean {\n  return providers?.[id]?.type === \"webauthn\"\n}","tryCatchPattern":"try {\n  await reactSignIn(providerId)\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes(\"webauthn\")) {\n    const { signIn } = await import(\"next-auth/webauthn\")\n    await signIn(providerId)\n  } else throw e\n}","preventionTips":["Dispatch sign-in by provider type instead of importing one signIn statically","Use next-auth/react signIn only for credentials/oauth/email providers","Centralize sign-in logic in one helper aware of the provider type","Audit passkey flows after upgrading from next-auth v4"],"tags":["webauthn","provider","react","wrong-api","passkey"],"backgroundTag":"wrong-provider-entrypoint","analyzedSha":"a1a16a5a7780488c7449feece410033f445d0b31","analyzedAt":"2026-08-28T21:52:38.200Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}