Wire up email verification flow for new signups

requireEmailVerification was enabled but no sendVerificationEmail was
configured — new users saw "check your email", never received anything,
and couldn't log in (403 shown as "wrong email or password").

- email.ts: add verification email template; welcome email no longer
  claims the account is "confirmed"
- auth.ts: configure emailVerification (send on signup, resend on
  unverified login attempt, auto sign-in after verification, 24h TTL)
- register route: callbackURL=/dashboard so the verify link lands in
  the cabinet
- login form: distinguish 403 (unverified — tell user a fresh link was
  sent) and 429 (rate limit) from wrong credentials

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 14:01:46 +05:00
parent 619ae393bd
commit 2790a7d24b
4 changed files with 52 additions and 4 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ export async function POST(request: NextRequest) {
"Content-Type": "application/json",
Origin: baseUrl,
}),
body: JSON.stringify({ name, email, password }),
body: JSON.stringify({ name, email, password, callbackURL: "/dashboard" }),
})
);
}