Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit e1d1a97b authored by 65160381's avatar 65160381
Browse files

4

parent 877f2f10
Branches
No related tags found
No related merge requests found
Pipeline #639 passed with warnings
......@@ -10,11 +10,17 @@ module.exports = {
const { email, rpassword } = req.body;
try {
// Hash password
const hashedPassword = await bcrypt.hash(rpassword, 10);
// Insert user into the database
const query = 'INSERT INTO users (email, password) VALUES (?, ?)';
await pool.execute(query, [email, hashedPassword]);
// Send success message
req.flash('message', 'User registered successfully. Please log in.');
// Redirect to login page
res.redirect('/login');
} catch (err) {
console.error('Error inserting user:', err);
......@@ -22,3 +28,4 @@ module.exports = {
}
}
};
......@@ -36,7 +36,7 @@
<div class="header_section">
<div class="container-fluid">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="logo"><a href="/"><h1 style="color: aliceblue;" class="h1">Bookshop</h1></a></div>
<div class="logo"><a href="/"><h1 style="color: aliceblue;" class="h1">ASA SHOP</h1></a></div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav"aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
......
......@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><%= product.product_name %> | Bookshop</title>
<title><%= product.product_name %> | ASA SHOP</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/product.css">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment