Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.transporter.sendMail(msg, (err, info) => {
if (err) {
this.logger.warn("Unable to send email: ", err);
reject(new MoleculerRetryableError("Unable to send email! " + err.message));
} else {
this.logger.info("Email message sent.", info.response);
resolve(info);
}
});
}
return jwt.sign(payload, process.env.JWT_SECRET, { expiresIn: expiresIn || this.config["accounts.jwt.expiresIn"] }, (err, token) => {
if (err) {
this.logger.warn("JWT token generation error:", err);
return reject(new MoleculerRetryableError("Unable to generate token", 500, "UNABLE_GENERATE_TOKEN"));
}
resolve(token);
});
});