Added notifications for actual news
Some checks failed
Code Analysis and Production Deploy / analyze (push) Failing after 5m59s
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-11 09:02:58 +02:00
parent c7a306e8fa
commit da1efa5a74
7 changed files with 497 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
import { readUsers, writeUsers, hashPassword } from '../../utils/auth.js'
import { sendRegistrationNotification } from '../../utils/email-service.js'
import { assertPasswordNotPwned } from '../../utils/hibp.js'
import { sendNewUserRegistrationPush } from '../../utils/push-notifications.js'
export default defineEventHandler(async (event) => {
try {
@@ -59,6 +60,10 @@ export default defineEventHandler(async (event) => {
users.push(newUser)
await writeUsers(users)
sendNewUserRegistrationPush(newUser)
.then(result => console.info('Registrierungs-Push Ergebnis:', { userId: newUser.id, ...result }))
.catch(error => console.error('Registrierungs-Push fehlgeschlagen:', error))
// Send notification to Vorstand/admin via central email service
try {
await sendRegistrationNotification({ name, email, phone })