From 0bd3a1da931b72a20820dcd45220129177a00935 Mon Sep 17 00:00:00 2001 From: singharaj usai Date: Mon, 7 Oct 2024 00:58:03 -0400 Subject: [PATCH] disable maintenance mode temporarily to test email verification --- server/functions/api/routes/auth.js | 4 +++- server/server.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/functions/api/routes/auth.js b/server/functions/api/routes/auth.js index db9857c..cb6e0b8 100644 --- a/server/functions/api/routes/auth.js +++ b/server/functions/api/routes/auth.js @@ -134,6 +134,8 @@ const validateUser = [ router.post("/register-create", async (req, res) => { try { const { username, email, password } = req.body; + console.log("Registration attempt for:", email); + const hashedPassword = await bcrypt.hash(password, 10); const clientIp = getClientIp(req); const verificationToken = crypto.randomBytes(64).toString('hex'); @@ -163,7 +165,7 @@ router.post("/register-create", async (req, res) => { await user.save(); // send email verification link - const verificationLink = `${process.env.BASE_URL}/api/auth/verify-email/${verificationToken}`; + const verificationLink = `http://localhost:3000/auth/verify/${verificationToken}`; await transporter.sendMail({ from: process.env.EMAIL_USER, diff --git a/server/server.js b/server/server.js index 7f9af66..2839984 100644 --- a/server/server.js +++ b/server/server.js @@ -29,7 +29,7 @@ const port = process.env.PORT || 3000; // Environment vars const MONGODB_URI = process.env.MONGODB_URI; -const MAINTENANCE_MODE = process.env.MAINTENANCE_MODE === 'true'; +const MAINTENANCE_MODE = process.env.MAINTENANCE_MODE === 'false'; const SECRET_KEY = process.env.MAINTENANCE_SECRET_KEY || 'default_secret_key';