Explorar el Código

be consistent with from field in emails

Florian Ludwig hace 6 años
padre
commit
f2b4fa9358
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 1 1
      server/controllers/authController.js
  2. 1 1
      server/controllers/urlController.js

+ 1 - 1
server/controllers/authController.js

@@ -182,7 +182,7 @@ exports.requestPasswordReset = async ({ body: { email } }, res) => {
     return res.status(400).json({ error: "Couldn't reset password." });
   }
   const mail = await transporter.sendMail({
-    from: process.env.MAIL_USER,
+    from: process.env.MAIL_FROM || process.env.MAIL_USER,
     to: user.email,
     subject: 'Reset your password',
     text: resetMailText

+ 1 - 1
server/controllers/urlController.js

@@ -314,7 +314,7 @@ exports.reportUrl = async ({ body: { url } }, res) => {
   if (!isValidUrl) return res.status(400).json({ error: 'URL is not valid.' });
 
   const mail = await transporter.sendMail({
-    from: process.env.MAIL_USER,
+    from: process.env.MAIL_FROM || process.env.MAIL_USER,
     to: process.env.REPORT_MAIL,
     subject: '[REPORT]',
     text: url,