* 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) {
|
||||
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 = {
|
||||
host: process.env.EMAIL_SERVER_HOST,
|
||||
port,
|
||||
auth: {
|
||||
user: process.env.EMAIL_SERVER_USER,
|
||||
pass: process.env.EMAIL_SERVER_PASSWORD,
|
||||
},
|
||||
auth,
|
||||
secure: port === 465,
|
||||
tls: {
|
||||
rejectUnauthorized: !isENVDev,
|
||||
|
|
Loading…
Reference in New Issue