Bugfixing
Some checks failed
Code Analysis and Production Deploy / analyze (push) Failing after 6m10s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Has been skipped

This commit is contained in:
Torsten Schulz (local)
2026-06-23 16:21:53 +02:00
parent b69130c2b2
commit f29e8a4dac
10 changed files with 225 additions and 57 deletions

View File

@@ -1,15 +1,11 @@
import fs from 'fs/promises'
import path from 'path'
import { requireUserWithAnyRole } from '../../utils/auth.js'
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' })
}
await requireUserWithAnyRole(event, 'admin', 'vorstand')
const config = useRuntimeConfig()
const encryptionKey = config.encryptionKey || 'local_development_encryption_key_change_in_production'

View File

@@ -1,10 +1,13 @@
import fs from 'fs/promises'
import path from 'path'
import { requireUserWithAnyRole } from '../../utils/auth.js'
import { decryptObject } from '../../utils/encryption.js'
import { saveMember } from '../../utils/members.js'
export default defineEventHandler(async (event) => {
try {
await requireUserWithAnyRole(event, 'admin', 'vorstand')
const { id, status, notes } = await readBody(event)
if (!id || !status) {