Skip to content

Commit 7aa854f

Browse files
committed
more logging
1 parent 8a114b5 commit 7aa854f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ app.post("/register", async (req, res) => {
9595
// Check if email already exists
9696
let sql = "SELECT * FROM users WHERE email = ?";
9797
let rows = await conn.query(sql, [userEmail]);
98+
9899
if (rows.length > 0) {
100+
console.log(
101+
`User with email ${userEmail} already exists: ${rows[0].toString()}`,
102+
);
99103
// If the account is not active, resend the confirmation email
100104
if (!rows[0].active) {
101105
sql = "SELECT token FROM confirmations WHERE user_id = ?";
@@ -120,6 +124,7 @@ app.post("/register", async (req, res) => {
120124
);
121125
}
122126
} else {
127+
123128
res.status(400).send("Account already exists and is active.");
124129
}
125130
return;

0 commit comments

Comments
 (0)