Updates to routes
This commit is contained in:
@@ -173,7 +173,7 @@ app.post('/register', async (req, res) => {
|
||||
await db.none('INSERT INTO users (username, password) VALUES ($1, $2)', [req.body.username, hash]);
|
||||
|
||||
// Redirect user to the login page after successful registration
|
||||
res.redirect('/login');
|
||||
res.redirect('/home');
|
||||
} catch (error) {
|
||||
// If an error occurs during registration, respond with status 500 and an error message
|
||||
res.status(500).json({ status: 'error', message: 'An error occurred during registration' });
|
||||
|
||||
Reference in New Issue
Block a user