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:
- Sign in with GitHub
- Register a WebAuthn credential
- Sign out & Sign in with GitHub again
- Verify the WebAuthn credential