Register Nachricht
This commit is contained in:
parent
5327ac2f8b
commit
3275c31192
3
app.js
3
app.js
|
@ -213,7 +213,8 @@ app.post('/register', async (req, res) => {
|
|||
try {
|
||||
const hashedPassword = await bcrypt.hash(password, 10);
|
||||
await pool.query('INSERT INTO users (username, password) VALUES ($1, $2)', [username, hashedPassword]);
|
||||
res.redirect('/login');
|
||||
const message = 'Registrierung erfolgreich. Ein Admin wird dich in kürze freischalten';
|
||||
res.render('error', {session: req.session, message});
|
||||
} catch (error) {
|
||||
console.error('Error registering user:', error);
|
||||
const message = 'Error registering user:' + error;
|
||||
|
|
Loading…
Reference in New Issue