refactor: ponytail audit

This commit is contained in:
Amruth Pillai
2026-07-27 20:26:16 +02:00
parent bb1fb3a7d6
commit 9110e86997
157 changed files with 1082 additions and 2177 deletions
+2 -5
View File
@@ -13,17 +13,14 @@ type SendEmailOptions = {
from?: string;
};
const isSmtpEnabled = () => {
return !!env.SMTP_HOST && !!env.SMTP_USER && !!env.SMTP_PASS && !!env.SMTP_FROM;
};
const isSmtpEnabled = () => !!env.SMTP_HOST && !!env.SMTP_USER && !!env.SMTP_PASS && !!env.SMTP_FROM;
let cachedTransport: Transporter | undefined;
const getTransport = () => {
if (!isSmtpEnabled()) return;
if (cachedTransport) return cachedTransport;
cachedTransport = nodemailer.createTransport({
cachedTransport ??= nodemailer.createTransport({
host: env.SMTP_HOST,
port: env.SMTP_PORT,
secure: env.SMTP_SECURE,