Update Apache SSL configuration and enhance security features across multiple files. Changed X-Frame-Options to SAMEORIGIN for better security, added optional Content Security Policy headers for testing, and improved password handling with HaveIBeenPwned checks during user registration and password reset. Implemented passkey login functionality in the authentication flow, including UI updates for user experience. Enhanced image upload processing with size limits and validation, and added rate limiting for various API endpoints to prevent abuse.

This commit is contained in:
Torsten Schulz (local)
2026-01-05 11:50:57 +01:00
parent 51214c8964
commit 5ce064cff0
47 changed files with 1738 additions and 83 deletions

View File

@@ -1,4 +1,5 @@
import { getUserFromToken, readUsers, writeUsers, hasAnyRole, migrateUserRoles } from '../../../utils/auth.js'
import { writeAuditLog } from '../../../utils/audit-log.js'
export default defineEventHandler(async (event) => {
try {
@@ -39,10 +40,18 @@ export default defineEventHandler(async (event) => {
migrateUserRoles(user)
// Setze Rollen
const oldRoles = Array.isArray(user.roles) ? [...user.roles] : []
user.roles = rolesArray
const updatedUsers = users.map(u => u.id === userId ? user : u)
await writeUsers(updatedUsers)
await writeAuditLog('cms.user.roles.updated', {
actorUserId: currentUser.id,
targetUserId: userId,
oldRoles,
newRoles: rolesArray
})
return {
success: true,
message: 'Rolle wurde aktualisiert'