fix: validate Resend API key before creating mail transport (#2672)

This commit is contained in:
chaoliang yan
2026-04-07 12:08:29 +10:00
committed by GitHub
parent 6f650e1c2f
commit 229cd2f7e9
+5 -1
View File
@@ -64,9 +64,13 @@ const getTransport = (): Transporter => {
}
if (transport === 'resend') {
if (!env('NEXT_PRIVATE_RESEND_API_KEY')) {
throw new Error('Resend transport requires NEXT_PRIVATE_RESEND_API_KEY');
}
return createTransport(
ResendTransport.makeTransport({
apiKey: env('NEXT_PRIVATE_RESEND_API_KEY') || '',
apiKey: env('NEXT_PRIVATE_RESEND_API_KEY'),
}),
);
}