Added notifications for actual news
This commit is contained in:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user