Refactor environment configuration for local development; update SMTP settings and add JWT secret, encryption key, and debug options. Enhance Nuxt configuration for development server and runtime settings. Introduce new membership application form with validation and PDF generation functionality. Update footer and navigation components to include new membership links. Revise user and session data in JSON files.

This commit is contained in:
Torsten Schulz (local)
2025-10-23 01:31:45 +02:00
parent de73ceb62f
commit 7cd39bb452
43 changed files with 3350 additions and 457 deletions

View File

@@ -0,0 +1,72 @@
import fs from 'fs/promises'
import path from 'path'
import { decryptObject } from '../../utils/encryption.js'
export default defineEventHandler(async (event) => {
try {
const config = useRuntimeConfig()
const encryptionKey = config.encryptionKey
if (!encryptionKey) {
throw createError({
statusCode: 500,
statusMessage: 'Verschlüsselungsschlüssel nicht konfiguriert'
})
}
const dataDir = path.join(process.cwd(), 'server/data/membership-applications')
// Prüfen ob Verzeichnis existiert
try {
await fs.access(dataDir)
} catch {
return []
}
// Alle Anträge laden
const files = await fs.readdir(dataDir)
const applications = []
for (const file of files) {
if (file.endsWith('.json')) {
try {
const filePath = path.join(dataDir, file)
const fileContent = await fs.readFile(filePath, 'utf8')
const applicationData = JSON.parse(fileContent)
// Verschlüsselte Daten entschlüsseln
const decryptedData = decryptObject(applicationData.encryptedData, encryptionKey)
applications.push({
id: applicationData.id,
timestamp: applicationData.timestamp,
status: applicationData.status,
metadata: applicationData.metadata,
// Entschlüsselte persönliche Daten
personalData: {
nachname: decryptedData.nachname,
vorname: decryptedData.vorname,
email: decryptedData.email,
telefon_privat: decryptedData.telefon_privat,
telefon_mobil: decryptedData.telefon_mobil
}
})
} catch (error) {
console.error(`Fehler beim Laden von ${file}:`, error)
}
}
}
// Nach Zeitstempel sortieren (neueste zuerst)
applications.sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp))
return applications
} catch (error) {
console.error('Fehler beim Laden der Mitgliedschaftsanträge:', error)
throw createError({
statusCode: 500,
statusMessage: 'Fehler beim Laden der Anträge'
})
}
})