Explorar o código

Remove hardcoded email config for dev

poeti8 %!s(int64=7) %!d(string=hai) anos
pai
achega
47388e4593
Modificáronse 1 ficheiros con 9 adicións e 22 borrados
  1. 9 22
      server/mail/mail.js

+ 9 - 22
server/mail/mail.js

@@ -1,28 +1,15 @@
 const config = require('../config');
 const nodemailer = require('nodemailer');
 
-let mailConfig = {};
-
-if (process.env.NODE_ENV === 'production') {
-  mailConfig = {
-    host: config.MAIL_HOST,
-    port: config.MAIL_PORT,
-    secure: config.MAIL_SECURE,
-    auth: {
-      user: config.MAIL_USER,
-      pass: config.MAIL_PASSWORD,
-    },
-  };
-} else {
-  mailConfig = {
-    host: 'smtp.ethereal.email',
-    port: 587,
-    auth: {
-      user: 'likyqc3fcjtgdnfd@ethereal.email',
-      pass: 'fjmhsR8zJQZ3BKQath',
-    },
-  };
-}
+const mailConfig = {
+  host: config.MAIL_HOST,
+  port: config.MAIL_PORT,
+  secure: config.MAIL_SECURE,
+  auth: {
+    user: config.MAIL_USER,
+    pass: config.MAIL_PASSWORD,
+  },
+};
 
 const transporter = nodemailer.createTransport(mailConfig);
 module.exports = transporter;