Email bei registrierung

This commit is contained in:
Klaas 2024-05-29 21:28:35 +02:00
parent 9b96f960b2
commit 1339ba0b60
1 changed files with 2 additions and 2 deletions

4
app.js
View File

@ -209,10 +209,10 @@ const getRiegenMitgliederSortedByAge = async () => {
// Registrierung
app.post('/register', async (req, res) => {
const { username, password } = req.body;
const { username, email, password } = req.body;
try {
const hashedPassword = await bcrypt.hash(password, 10);
await pool.query('INSERT INTO users (username, password) VALUES ($1, $2)', [username, hashedPassword]);
await pool.query('INSERT INTO users (username, email, password) VALUES ($1, $2, $3)', [username, email, hashedPassword]);
const message = 'Registrierung erfolgreich. Ein Admin wird dich in kürze freischalten';
const mailOptions = {
to: 'admin@boergmann.it',