two-factor-authentication-best-practices
Originally frombetter-auth/skills
Installation
SKILL.md
Setup
- Add
twoFactor()plugin to server config withissuer - Add
twoFactorClient()plugin to client config - Run
npx auth@latest migrate(built-in adapter) or generate + push for Drizzle/Prisma - Verify: check that
twoFactorSecretcolumn exists on user table
import { betterAuth } from "better-auth";
import { twoFactor } from "better-auth/plugins";