Refactor file handling to prioritize internal data directories for backups and uploads; enhance error handling and logging for metadata and CSV operations.
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 47s
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 47s
This commit is contained in:
@@ -4,6 +4,13 @@ import { decryptObject } from '../../utils/encryption.js'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
try {
|
||||
// Nur Vorstand oder Admin darf Mitgliedschaftsantraege lesen
|
||||
const token = getCookie(event, 'auth_token')
|
||||
const currentUser = token ? await getUserFromToken(token) : null
|
||||
if (!currentUser || !hasAnyRole(currentUser, 'admin', 'vorstand')) {
|
||||
throw createError({ statusCode: 403, statusMessage: 'Zugriff verweigert' })
|
||||
}
|
||||
|
||||
const config = useRuntimeConfig()
|
||||
const encryptionKey = config.encryptionKey || 'local_development_encryption_key_change_in_production'
|
||||
|
||||
@@ -73,7 +80,7 @@ export default defineEventHandler(async (event) => {
|
||||
// Nach Zeitstempel sortieren (neueste zuerst)
|
||||
applications.sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp))
|
||||
|
||||
return applications
|
||||
return applications
|
||||
|
||||
} catch (error) {
|
||||
console.error('Fehler beim Laden der Mitgliedschaftsanträge:', error)
|
||||
|
||||
Reference in New Issue
Block a user