mirror of
https://github.com/documenso/documenso.git
synced 2026-07-26 01:45:08 +10:00
fix: validate Resend API key before creating mail transport (#2672)
This commit is contained in:
@@ -64,9 +64,13 @@ const getTransport = (): Transporter => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (transport === 'resend') {
|
if (transport === 'resend') {
|
||||||
|
if (!env('NEXT_PRIVATE_RESEND_API_KEY')) {
|
||||||
|
throw new Error('Resend transport requires NEXT_PRIVATE_RESEND_API_KEY');
|
||||||
|
}
|
||||||
|
|
||||||
return createTransport(
|
return createTransport(
|
||||||
ResendTransport.makeTransport({
|
ResendTransport.makeTransport({
|
||||||
apiKey: env('NEXT_PRIVATE_RESEND_API_KEY') || '',
|
apiKey: env('NEXT_PRIVATE_RESEND_API_KEY'),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user