diff --git a/apps/api/src/lib/auth.ts b/apps/api/src/lib/auth.ts index 601708e..fe41e35 100644 --- a/apps/api/src/lib/auth.ts +++ b/apps/api/src/lib/auth.ts @@ -4,7 +4,6 @@ import { Resend } from "resend"; import { db } from "@lila/db"; import * as schema from "@lila/db/schema"; -const resend = new Resend(process.env["RESEND_API_KEY"]); const emailFrom = process.env["EMAIL_FROM"] ?? "noreply@lilastudy.com"; export const auth = betterAuth({ @@ -30,6 +29,7 @@ export const auth = betterAuth({ user: { email: string }; url: string; }) => { + const resend = new Resend(process.env["RESEND_API_KEY"]); await resend.emails.send({ from: emailFrom, to: user.email, @@ -48,6 +48,7 @@ export const auth = betterAuth({ user: { email: string }; url: string; }) => { + const resend = new Resend(process.env["RESEND_API_KEY"]); await resend.emails.send({ from: emailFrom, to: user.email,