Commit 950be757 authored by Fabien Forestier's avatar Fabien Forestier
Browse files

Removing auth from SMTP config if null

parent db07e67b
Pipeline #7052 passed with stage
in 6 seconds
......@@ -11,13 +11,8 @@ export class ConfigService {
this._config.smtpConfig.port = process.env.SMTP_PORT;
if (process.env.SMTP_USER && process.env.SMTP_PASSWORD) {
this._config.smtpConfig = {
...this._config.smtpConfig,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASSWORD,
},
};
this._config.smtpConfig.auth.user = process.env.SMTP_USER;
this._config.smtpConfig.auth.pass = process.env.SMTP_PASSWORD;
}
this._config.mailSubjectPrefix = process.env.MAIL_SUBJECT_PREFIX;
this._config.userSupportMailbox = process.env.USER_SUPPORT_MAILBOX;
......@@ -30,6 +25,14 @@ export class ConfigService {
}
get config() {
const filteredConf = { ...this._config };
if (
!this._config.smtpConfig.auth.user &&
!this._config.smtpConfig.auth.pass
) {
delete this._config.smtpConfig.auth;
}
return this._config;
}
}
......@@ -7,6 +7,10 @@ export const config = {
// do not fail on invalid certs
rejectUnauthorized: false,
},
auth: {
user: null,
pass: null,
},
},
userSupportMailbox: '',
imageHost: '',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment