2FA with WebAuthn using NextAuth.js.

This example shows how to use NextAuth.js to add 2FA with WebAuthn. See the source on GitHub. It uses SimpleWebAuthn, Vercel KV, and RedisUpstashAdapter. The steps are:

  1. Sign in with GitHub
  2. Register a WebAuthn credential
  3. Sign out & Sign in with GitHub again
  4. Verify the WebAuthn credential