mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🔧 fix: Correct Properties Passed to getResponseSender, Catch OpenAI Errors (#1244)
* fix: attempt to catch more errors, especially when generation started * fix: pass the right properties to getResponseSender * chore: Update .eslintrc.js and fix sendEmail.js linting errors
This commit is contained in:
parent
ae03267d9b
commit
e13b146d6d
10 changed files with 22 additions and 15 deletions
|
|
@ -7,18 +7,18 @@ const sendEmail = async (email, subject, payload, template) => {
|
|||
try {
|
||||
const transporterOptions = {
|
||||
// Use STARTTLS by default instead of obligatory TLS
|
||||
secure: process.env.EMAIL_ENCRYPTION === "tls",
|
||||
secure: process.env.EMAIL_ENCRYPTION === 'tls',
|
||||
// If explicit STARTTLS is set, require it when connecting
|
||||
requireTls: process.env.EMAIL_ENCRYPTION === "starttls",
|
||||
requireTls: process.env.EMAIL_ENCRYPTION === 'starttls',
|
||||
tls: {
|
||||
// Whether to accept unsigned certificates
|
||||
rejectUnauthorized: process.env.EMAIL_ALLOW_SELFSIGNED === "true"
|
||||
rejectUnauthorized: process.env.EMAIL_ALLOW_SELFSIGNED === 'true',
|
||||
},
|
||||
auth: {
|
||||
user: process.env.EMAIL_USERNAME,
|
||||
pass: process.env.EMAIL_PASSWORD,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
if (process.env.EMAIL_ENCRYPTION_HOSTNAME) {
|
||||
// Check the certificate against this name explicitly
|
||||
|
|
@ -40,7 +40,8 @@ const sendEmail = async (email, subject, payload, template) => {
|
|||
const options = () => {
|
||||
return {
|
||||
// Header address should contain name-addr
|
||||
from: `"${process.env.EMAIL_FROM_NAME || process.env.APP_TITLE}"` +
|
||||
from:
|
||||
`"${process.env.EMAIL_FROM_NAME || process.env.APP_TITLE}"` +
|
||||
`<${process.env.EMAIL_FROM}>`,
|
||||
to: `"${payload.name}" <${email}>`,
|
||||
envelope: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue