Documentation

Magic Links

While the starter focuses on passwords + OAuth, all the primitives for magic links already exist in Prisma.

Token storage

The `VerificationToken` model in `prisma/schema.prisma` mirrors what NextAuth Email providers expect. You can enable the email provider inside `authOptions` and reuse `sendVerificationEmail` for delivering the link.

Relevant files

  • prisma/schema.prisma — VerificationToken model
  • src/lib/email.ts — Email helper

Rate limiting

Use the `UsageRecord` collection or a simple Redis counter to cap how often a link is issued. The middleware already prevents unverified users from reaching the dashboard, so you only need to toggle the provider.

Relevant files

  • prisma/schema.prisma — Usage records
  • src/middleware.ts — Middleware guard