* mailhog server auth problem solved * put condition on transport auth * fixe type-check errorpull/10655/head^2
parent
57384eb921
commit
a3aa53fe6e
|
@ -10,13 +10,18 @@ function detectTransport(): SendmailTransport.Options | SMTPConnection.Options |
|
||||||
|
|
||||||
if (process.env.EMAIL_SERVER_HOST) {
|
if (process.env.EMAIL_SERVER_HOST) {
|
||||||
const port = parseInt(process.env.EMAIL_SERVER_PORT || "");
|
const port = parseInt(process.env.EMAIL_SERVER_PORT || "");
|
||||||
|
const auth =
|
||||||
|
process.env.EMAIL_SERVER_USER && process.env.EMAIL_SERVER_PASSWORD
|
||||||
|
? {
|
||||||
|
user: process.env.EMAIL_SERVER_USER,
|
||||||
|
pass: process.env.EMAIL_SERVER_PASSWORD,
|
||||||
|
}
|
||||||
|
: undefined;
|
||||||
|
|
||||||
const transport = {
|
const transport = {
|
||||||
host: process.env.EMAIL_SERVER_HOST,
|
host: process.env.EMAIL_SERVER_HOST,
|
||||||
port,
|
port,
|
||||||
auth: {
|
auth,
|
||||||
user: process.env.EMAIL_SERVER_USER,
|
|
||||||
pass: process.env.EMAIL_SERVER_PASSWORD,
|
|
||||||
},
|
|
||||||
secure: port === 465,
|
secure: port === 465,
|
||||||
tls: {
|
tls: {
|
||||||
rejectUnauthorized: !isENVDev,
|
rejectUnauthorized: !isENVDev,
|
||||||
|
|
Loading…
Reference in New Issue