Add birthdate handling in member registration and management. Update UI to conditionally require birthdate for new members, and enhance API to enforce birthdate validation. Improve tests to cover new birthdate requirements.
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 57s
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 57s
This commit is contained in:
@@ -5,12 +5,12 @@ import { assertPasswordNotPwned } from '../../utils/hibp.js'
|
||||
export default defineEventHandler(async (event) => {
|
||||
try {
|
||||
const body = await readBody(event)
|
||||
const { name, email, phone, password } = body
|
||||
const { name, email, phone, password, geburtsdatum, visibility } = body
|
||||
|
||||
if (!name || !email || !password) {
|
||||
if (!name || !email || !password || !geburtsdatum) {
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
message: 'Name, E-Mail und Passwort sind erforderlich'
|
||||
message: 'Name, E-Mail, Geburtsdatum und Passwort sind erforderlich'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -46,6 +46,10 @@ export default defineEventHandler(async (event) => {
|
||||
password: hashedPassword,
|
||||
name,
|
||||
phone: phone || '',
|
||||
geburtsdatum,
|
||||
visibility: {
|
||||
showBirthday: visibility?.showBirthday !== undefined ? Boolean(visibility.showBirthday) : true
|
||||
},
|
||||
role: 'mitglied',
|
||||
active: false, // Requires admin approval
|
||||
created: new Date().toISOString(),
|
||||
|
||||
Reference in New Issue
Block a user