Skip to content

Commit

Permalink
disable maintenance mode temporarily to test email verification
Browse files Browse the repository at this point in the history
  • Loading branch information
singharaj-usai committed Oct 7, 2024
1 parent 707cb6c commit 0bd3a1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion server/functions/api/routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';


Expand Down

0 comments on commit 0bd3a1d

Please sign in to comment.