Email bei registrierung
This commit is contained in:
parent
9b96f960b2
commit
1339ba0b60
4
app.js
4
app.js
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue