this is log when i installed: npm install bcryptjs cors dotenv express helmet jsonwebtoken mongoose morgan nodemailer zod && npm install -D @types/bcryptjs @types/cors @types/express @types/helmet @types/jsonwebtoken @types/mongoose @types/morgan @types/nodemailer ts-node-dev typescript
I think the error might be from your config file, can you try this approach just to be sure, that you have your jwt files properly called
// Ensure JWT secret is defined const jwtSecret = config.jwt.secret || "2e6767eed71s72s"; if (!jwtSecret) { res.status(500).json({ status: "error", message: "JWT secret is missing", }); return; } // Generate JWT token const token = jwt.sign({ userId: user._id.toString() }, jwtSecret, { expiresIn: config.jwt.expiresIn || "1h", // Default to 1 hour if undefined });
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
this is log when i installed:
npm install bcryptjs cors dotenv express helmet jsonwebtoken mongoose morgan nodemailer zod && npm install -D @types/bcryptjs @types/cors @types/express @types/helmet @types/jsonwebtoken @types/mongoose @types/morgan @types/nodemailer ts-node-dev typescript
I think the error might be from your config file, can you try this approach just to be sure, that you have your jwt files properly called