- user registration passwords have to match in order to be able to register

This commit is contained in:
Fabian 2025-04-29 12:50:58 +02:00
parent 482d7559d8
commit c6f33b142b
3 changed files with 21 additions and 9 deletions

View File

View File

@ -10,7 +10,7 @@
<title>Registrieren</title>
</head>
<body>
<div class="page-container">
<div class="page-container">
<!-- Header -->
<div id="header-placeholder"></div>
@ -58,6 +58,18 @@
document.getElementById('register').addEventListener('click', async (event) => {
event.preventDefault();
const passwordEl = document.getElementById('regPassword')
const password = passwordEl.value
const confirmPasswordEl = document.getElementById('confirmPassword')
const confirmPassword = confirmPasswordEl.value
if (password !== confirmPassword) {
passwordEl.value = ''
confirmPasswordEl.value= ''
alert('Die Passwörter stimmen nicht überein.')
return
}
const formData = {
name: document.getElementById('vorname').value,
lower_name: document.getElementById('nachname').value,
@ -77,7 +89,7 @@
const data = await response.json();
sessionStorage.setItem("user_id", data.id)
alert('Nutzer erfolgreich hinzugefügt! Ihre Kundennummer: ' + data.id)
window.location.href= '/'
window.location.href = '/'
} else {
alert('Fehler bei der Registrierung.')
}

View File