Add dotenv package for environment variable management and refactor SMTP credential handling in email services. Enhance error handling for missing SMTP credentials across various API endpoints to improve reliability and maintainability.
This commit is contained in:
@@ -674,7 +674,7 @@ export default defineEventHandler(async (event) => {
|
||||
// E-Mail senden
|
||||
emailResult = await sendMembershipEmail(data, filename, event)
|
||||
// Antragsdaten verschlüsselt speichern
|
||||
const encryptionKey = process.env.ENCRYPTION_KEY || 'default-key-change-in-production'
|
||||
const encryptionKey = process.env.ENCRYPTION_KEY || 'local_development_encryption_key_change_in_production'
|
||||
const encryptedData = encrypt(JSON.stringify(data), encryptionKey)
|
||||
const dataPath = path.join(uploadsDir, `${filename}.data`)
|
||||
await fs.writeFile(dataPath, encryptedData, 'utf8')
|
||||
@@ -730,7 +730,7 @@ export default defineEventHandler(async (event) => {
|
||||
emailResult = await sendMembershipEmail(data, filename, event)
|
||||
|
||||
// Antragsdaten verschlüsselt speichern
|
||||
const encryptionKey = process.env.ENCRYPTION_KEY || 'default-key-change-in-production'
|
||||
const encryptionKey = process.env.ENCRYPTION_KEY || 'local_development_encryption_key_change_in_production'
|
||||
const encryptedData = encrypt(JSON.stringify(data), encryptionKey)
|
||||
const dataPath = path.join(uploadsDir, `${filename}.data`)
|
||||
await fs.writeFile(dataPath, encryptedData, 'utf8')
|
||||
|
||||
Reference in New Issue
Block a user