Prompt
I'm building a Next.js app. what's the easiest way to send password reset emails?
Latest observation
Sep 24, 2026
OpenAI APIWeb search: off
The easiest path in a Next.js app is usually:
Option 1: Use a managed auth provider
If you want the least code and least maintenance, use something like:
- Supabase Auth
- Clerk
- Auth0
- Firebase Auth
- NextAuth/Auth.js plus your own email flow
These services can generate password reset emails, handle tokens, and give you a reset page or callback flow.
Best choice if you want “just works”:
- Clerk for fastest setup
- Supabase if you’re already using Postgres/Supabase
- Auth0 if you want enterprise features
Option 2: Send your own reset emails with an email service
If you want full control, the simplest setup is:
- Use Resend, Postmark, SendGrid, or Mailgun
- Generate a secure one-time reset token
- Store a hashed token with expiration in your DB
- Email the user a link like:
https://yourapp.com/reset-password?token=... - Verify token on the reset page and update the password
Easiest email provider for Next.js
I’d recommend Resend because it’s very straightforward with React/Next.js.
Simple recommended stack
If you’re building this yourself:
- Next.js App Router
- Prisma or your DB layer
- Resend for email delivery
- bcrypt or argon2 for password hashing
- nanoid or
crypto.randomBytes()for reset tokens
Basic flow
- User enters email on “Forgot password” page
- Your API route:
- checks if account exists
- creates reset token
- stores hashed token + expiry
- sends email
- User clicks email link
- Reset page accepts new password
- Server verifies token and updates password
- Token is invalidated
Important security notes
- Don’t reveal whether the email exists (“If that email exists, we sent a link”)
- Make tokens:
- random
- single-use
- short-lived, like 15–60 minutes
- Hash tokens in the DB, don’t store them raw
- Rate-limit the reset request endpoint
- Always use HTTPS
If you want the absolute easiest code path
Use Resend + a simple reset-token table.
If you want, I can give you:
- a full Next.js App Router example with Resend, Prisma, and reset pages, or
- the fastest setup using Clerk/Supabase.