diff --git a/ef-api/controllers/user.js b/ef-api/controllers/user.js index 11404ba..c14b37f 100644 --- a/ef-api/controllers/user.js +++ b/ef-api/controllers/user.js @@ -2,6 +2,7 @@ import dotenv from "dotenv"; import UserModal from "../models/user.js"; import bcrypt from "bcryptjs"; import jwt from "jsonwebtoken"; +import { sendEmail } from "../utils/sendEmail.js"; dotenv.config(); const secret = process.env.SECRET_KEY; @@ -37,12 +38,11 @@ export const signup = async (req, res) => { // Save the token in the user's tokens array result.tokens.push({ token }); - // Save the user await result.save(); - // console.log("ss", result) const url = `Click on the link ${process.env.RETURN_URL}/users/${result._id}/verify/${token}`; await sendEmail(result.email, "Verify Email", url); + console.log("url", url); // Send the user info and token back to the client res.status(201).json({ result, token });